cursorTds
protected final TdsCore cursorTds
Cursor TdsCore object.
initialRowCnt
protected int initialRowCnt
The row count of the initial result set.
insertRow
protected ParamInfo[] insertRow
Buffer row used for inserts.
isKeyed
protected boolean isKeyed
Table is keyed.
isSybase
protected boolean isSybase
Flag to indicate Sybase.
onInsertRow
protected boolean onInsertRow
Indicates currently inserting.
procName
protected final String procName
Original procedure name.
procedureParams
protected final ParamInfo[] procedureParams
Original parameters.
rowDeleted
protected boolean rowDeleted
Indicates that row has been deleted.
rowUpdated
protected boolean rowUpdated
Indicates that row has been updated.
sizeChanged
protected boolean sizeChanged
Fetch size has been changed.
sql
protected String sql
Original SQL statement.
tableName
protected String tableName
First table name in select.
tempResultSet
protected final boolean tempResultSet
True if this is a local temporary result set.
updateRow
protected ParamInfo[] updateRow
The "update" row.
updateTds
protected final TdsCore updateTds
Updates TdsCore object used for positioned updates.
CachedResultSet
(package private) CachedResultSet(JtdsResultSet rs,
boolean load)
throws SQLException
Creates a cached result set with the same columns (and optionally data)
as an existing result set.
rs
- the result set to copyload
- load data from the supplied result set
CachedResultSet
(package private) CachedResultSet(JtdsStatement statement,
String sql,
String procName,
ParamInfo[] procedureParams,
int resultSetType,
int concurrency)
throws SQLException
Constructs a new cached result set.
This result set will either be cached in memory or, if the cursor name
is set, can be a forward only server side cursor. This latter form of
cursor can also support positioned updates.
statement
- the parent statement objectsql
- the SQL statement used to build the result setprocName
- an optional stored procedure nameprocedureParams
- parameters for prepared statementsresultSetType
- the result set type eg scrollableconcurrency
- the result set concurrency eg updateable
CachedResultSet
(package private) CachedResultSet(JtdsStatement statement,
String[] colName,
int[] colType)
throws SQLException
Constructs a cached result set based on locally generated data.
statement
- the parent statement objectcolName
- array of column namescolType
- array of corresponding data types
CachedResultSet
(package private) CachedResultSet(JtdsStatement statement,
columns[] ,
data[] )
throws SQLException
Creates a cached result set containing one row.
statement
- the parent statement object
buildParameter
protected static ParamInfo buildParameter(int pos,
ColInfo info,
Object value,
boolean isUnicode)
throws SQLException
Creates a parameter object for an UPDATE, DELETE or INSERT statement.
pos
- the substitution position of the parameter marker in the SQLinfo
- the ColInfo
column descriptorvalue
- the column data item
- the new parameter as a
ParamInfo
object
buildWhereClause
(package private) ParamInfo[] buildWhereClause(StringBuffer sql,
ArrayList params,
boolean select)
throws SQLException
Builds a WHERE clause for UPDATE or DELETE statements.
sql
- the SQL Statement to append the WHERE clause toparams
- the parameter descriptor array for this statementselect
- true if this WHERE clause will be used in a select
statement
- the parameter list as a
ParamInfo[]
cursorClose
private void cursorClose()
throws SQLException
Closes the result set.
cursorCreate
private void cursorCreate()
throws SQLException
Creates a new scrollable result set in memory or a named server cursor.
cursorFetch
private boolean cursorFetch(int rowNum)
throws SQLException
Fetches the next result row from the internal row array.
rowNum
- the row number to fetch
true
if a result set row is returned
isCursorUpdateable
(package private) boolean isCursorUpdateable()
throws SQLException
Analyses the tables in the result set and determines if the primary key
columns needed to make it updateable exist.
Sybase (and SQL 6.5) will automatically include any additional key and
timestamp columns as hidden fields even if the user does not reference
them in the select statement.
If the table is unkeyed but there is an identity column then this is
promoted to a key.
Alternatively we can update, provided all the columns in the table row
have been selected, by regarding all of them as keys.
SQL Server 7+ does not return the correct primary key meta data for
temporary tables so the driver has to query the catalog to locate any
keys.
true
if there is one table and it is keyed
refreshKeyedRows
protected void refreshKeyedRows()
throws SQLException
Refreshes a result set row from keyed tables.
If all the tables in the result set have primary keys then the result
set row can be refreshed by refetching the individual table rows.
refreshReRead
protected void refreshReRead()
throws SQLException
Refreshes the row by rereading the result set.
Obviously very slow on large result sets but may be the only option if
tables do not have keys.
setColValue
protected Object setColValue(int colIndex,
int jdbcType,
Object value,
int length)
throws SQLException
Sets the specified column's data value.
- setColValue in interface JtdsResultSet
colIndex
- index of the columnvalue
- new column value
- the value, possibly converted to an internal type
setConcurrency
(package private) void setConcurrency(int concurrency)
Modify the concurrency of the result set.
Use to make result set read only once loaded.
concurrency
- the concurrency value eg
ResultSet.CONCUR_READ_ONLY