public class CachedResultSet extends JtdsResultSet
| Modifier and Type | Field and Description |
|---|---|
protected JtdsConnection |
connection
The parent connection object
|
protected TdsCore |
cursorTds
Cursor TdsCore object.
|
protected ParamInfo[] |
insertRow
Buffer row used for inserts.
|
protected boolean |
isKeyed
Table is keyed.
|
protected boolean |
isSybase
Flag to indicate Sybase.
|
protected boolean |
onInsertRow
Indicates currently inserting.
|
protected ParamInfo[] |
procedureParams
Original parameters.
|
protected java.lang.String |
procName
Original procedure name.
|
protected boolean |
rowDeleted
Indicates that row has been deleted.
|
protected boolean |
rowUpdated
Indicates that row has been updated.
|
protected boolean |
sizeChanged
Fetch size has been changed.
|
protected java.lang.String |
sql
Original SQL statement.
|
protected java.lang.String |
tableName
First table name in select.
|
protected boolean |
tempResultSet
True if this is a local temporary result set.
|
protected ParamInfo[] |
updateRow
The "update" row.
|
protected TdsCore |
updateTds
Updates TdsCore object used for positioned updates.
|
cancelled, CLOSE_CURSORS_AT_COMMIT, closed, columnCount, columns, concurrency, currentRow, cursorName, direction, fetchDirection, fetchSize, HOLD_CURSORS_OVER_COMMIT, INITIAL_ROW_COUNT, pos, POS_AFTER_LAST, POS_BEFORE_FIRST, resultSetType, rowData, rowPtr, rowsInResult, statement, wasNull| Constructor and Description |
|---|
CachedResultSet(JtdsResultSet rs,
boolean load)
Creates a cached result set with the same columns (and optionally data)
as an existing result set.
|
CachedResultSet(JtdsStatement statement,
ColInfo[] columns,
java.lang.Object[] data)
Creates a cached result set containing one row.
|
CachedResultSet(JtdsStatement statement,
java.lang.String[] colName,
int[] colType)
Constructs a cached result set based on locally generated data.
|
CachedResultSet(JtdsStatement statement,
java.lang.String sql,
java.lang.String procName,
ParamInfo[] procedureParams,
int resultSetType,
int concurrency)
Constructs a new cached result set.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
absolute(int row) |
(package private) void |
addRow(java.lang.Object[] data)
Warning!
|
void |
afterLast() |
void |
beforeFirst() |
protected static ParamInfo |
buildParameter(int pos,
ColInfo info,
java.lang.Object value,
boolean isUnicode)
Creates a parameter object for an UPDATE, DELETE or INSERT statement.
|
(package private) ParamInfo[] |
buildWhereClause(java.lang.StringBuilder sql,
java.util.ArrayList params,
boolean select)
Builds a WHERE clause for UPDATE or DELETE statements.
|
void |
cancelRowUpdates() |
void |
close() |
private void |
cursorClose()
Closes the result set.
|
private void |
cursorCreate()
Creates a new scrollable result set in memory or a named server cursor.
|
private boolean |
cursorFetch(int rowNum)
Fetches the next result row from the internal row array.
|
void |
deleteRow() |
boolean |
first() |
java.lang.String |
getCursorName() |
void |
insertRow() |
(package private) boolean |
isCursorUpdateable()
Analyses the tables in the result set and determines if the primary key
columns needed to make it updateable exist.
|
boolean |
isLast() |
boolean |
last() |
void |
moveToCurrentRow() |
void |
moveToInsertRow() |
boolean |
next() |
boolean |
previous() |
protected void |
refreshKeyedRows()
Refreshes a result set row from keyed tables.
|
protected void |
refreshReRead()
Refreshes the row by rereading the result set.
|
void |
refreshRow() |
boolean |
relative(int row) |
boolean |
rowDeleted() |
boolean |
rowInserted() |
boolean |
rowUpdated() |
protected java.lang.Object |
setColValue(int colIndex,
int jdbcType,
java.lang.Object value,
int length)
Sets the specified column's data value.
|
(package private) void |
setConcurrency(int concurrency)
Modify the concurrency of the result set.
|
void |
setFetchSize(int size) |
void |
updateRow() |
cacheResultSetRows, checkOpen, checkScrollable, checkUpdateable, clearWarnings, copyInfo, copyRow, findColumn, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getColumn, getColumnCount, getColumns, getConcurrency, getCurrentRow, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFetchSize, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRow, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, isAfterLast, isBeforeFirst, isClosed, isFirst, isWrapperFor, newRow, notImplemented, setColLabel, setColName, setColType, setColumnCount, setFetchDirection, unwrap, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNullprotected boolean onInsertRow
protected ParamInfo[] insertRow
protected ParamInfo[] updateRow
protected boolean rowUpdated
protected boolean rowDeleted
protected final boolean tempResultSet
protected final TdsCore cursorTds
protected final TdsCore updateTds
protected boolean isSybase
protected boolean sizeChanged
protected java.lang.String sql
protected final java.lang.String procName
protected final ParamInfo[] procedureParams
protected boolean isKeyed
protected java.lang.String tableName
protected JtdsConnection connection
CachedResultSet(JtdsStatement statement, java.lang.String sql, java.lang.String procName, ParamInfo[] procedureParams, int resultSetType, int concurrency) throws java.sql.SQLException
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 updateablejava.sql.SQLException - if an error occursCachedResultSet(JtdsStatement statement, java.lang.String[] colName, int[] colType) throws java.sql.SQLException
statement - the parent statement objectcolName - array of column namescolType - array of corresponding data typesjava.sql.SQLException - if an error occursCachedResultSet(JtdsResultSet rs, boolean load) throws java.sql.SQLException
rs - the result set to copyload - load data from the supplied result setjava.sql.SQLException - if an error occursCachedResultSet(JtdsStatement statement, ColInfo[] columns, java.lang.Object[] data) throws java.sql.SQLException
statement - the parent statement objectcolumns - the column descriptor arraydata - the row datajava.sql.SQLException - if an error occursvoid addRow(java.lang.Object[] data)
Warning! Ensure the provided data matches the column layout of this
ResultSet. All kind of weird behavior and errors could be expected
otherwise.
data - data of the row to addvoid setConcurrency(int concurrency)
concurrency - the concurrency value eg
ResultSet.CONCUR_READ_ONLYprivate void cursorCreate()
throws java.sql.SQLException
java.sql.SQLException - if an error occursboolean isCursorUpdateable()
throws java.sql.SQLException
true if there is one table and it is keyedjava.sql.SQLExceptionprivate boolean cursorFetch(int rowNum)
throws java.sql.SQLException
rowNum - the row number to fetchtrue if a result set row is returnedjava.sql.SQLException - if an error occursprivate void cursorClose()
throws java.sql.SQLException
java.sql.SQLExceptionprotected static ParamInfo buildParameter(int pos, ColInfo info, java.lang.Object value, boolean isUnicode) throws java.sql.SQLException
pos - the substitution position of the parameter marker in the SQLinfo - the ColInfo column descriptorvalue - the column data itemParamInfo objectjava.sql.SQLExceptionprotected java.lang.Object setColValue(int colIndex,
int jdbcType,
java.lang.Object value,
int length)
throws java.sql.SQLException
setColValue in class JtdsResultSetcolIndex - index of the columnvalue - new column valuelength - the length of a stream parameterjava.sql.SQLExceptionParamInfo[] buildWhereClause(java.lang.StringBuilder sql, java.util.ArrayList params, boolean select) throws java.sql.SQLException
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
statementParamInfo[]java.sql.SQLException - if an error occursprotected void refreshKeyedRows()
throws java.sql.SQLException
java.sql.SQLException - if an error occursprotected void refreshReRead()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void setFetchSize(int size)
throws java.sql.SQLException
setFetchSize in interface java.sql.ResultSetsetFetchSize in class JtdsResultSetjava.sql.SQLExceptionpublic void afterLast()
throws java.sql.SQLException
afterLast in interface java.sql.ResultSetafterLast in class JtdsResultSetjava.sql.SQLExceptionpublic void beforeFirst()
throws java.sql.SQLException
beforeFirst in interface java.sql.ResultSetbeforeFirst in class JtdsResultSetjava.sql.SQLExceptionpublic void cancelRowUpdates()
throws java.sql.SQLException
cancelRowUpdates in interface java.sql.ResultSetcancelRowUpdates in class JtdsResultSetjava.sql.SQLExceptionpublic void close()
throws java.sql.SQLException
close in interface java.lang.AutoCloseableclose in interface java.sql.ResultSetclose in class JtdsResultSetjava.sql.SQLExceptionpublic void deleteRow()
throws java.sql.SQLException
deleteRow in interface java.sql.ResultSetdeleteRow in class JtdsResultSetjava.sql.SQLExceptionpublic void insertRow()
throws java.sql.SQLException
insertRow in interface java.sql.ResultSetinsertRow in class JtdsResultSetjava.sql.SQLExceptionpublic void moveToCurrentRow()
throws java.sql.SQLException
moveToCurrentRow in interface java.sql.ResultSetmoveToCurrentRow in class JtdsResultSetjava.sql.SQLExceptionpublic void moveToInsertRow()
throws java.sql.SQLException
moveToInsertRow in interface java.sql.ResultSetmoveToInsertRow in class JtdsResultSetjava.sql.SQLExceptionpublic void refreshRow()
throws java.sql.SQLException
refreshRow in interface java.sql.ResultSetrefreshRow in class JtdsResultSetjava.sql.SQLExceptionpublic void updateRow()
throws java.sql.SQLException
updateRow in interface java.sql.ResultSetupdateRow in class JtdsResultSetjava.sql.SQLExceptionpublic boolean first()
throws java.sql.SQLException
first in interface java.sql.ResultSetfirst in class JtdsResultSetjava.sql.SQLExceptionpublic boolean isLast()
throws java.sql.SQLException
isLast in interface java.sql.ResultSetisLast in class JtdsResultSetjava.sql.SQLExceptionpublic boolean last()
throws java.sql.SQLException
last in interface java.sql.ResultSetlast in class JtdsResultSetjava.sql.SQLExceptionpublic boolean next()
throws java.sql.SQLException
next in interface java.sql.ResultSetnext in class JtdsResultSetjava.sql.SQLExceptionpublic boolean previous()
throws java.sql.SQLException
previous in interface java.sql.ResultSetprevious in class JtdsResultSetjava.sql.SQLExceptionpublic boolean rowDeleted()
throws java.sql.SQLException
rowDeleted in interface java.sql.ResultSetrowDeleted in class JtdsResultSetjava.sql.SQLExceptionpublic boolean rowInserted()
throws java.sql.SQLException
rowInserted in interface java.sql.ResultSetrowInserted in class JtdsResultSetjava.sql.SQLExceptionpublic boolean rowUpdated()
throws java.sql.SQLException
rowUpdated in interface java.sql.ResultSetrowUpdated in class JtdsResultSetjava.sql.SQLExceptionpublic boolean absolute(int row)
throws java.sql.SQLException
absolute in interface java.sql.ResultSetabsolute in class JtdsResultSetjava.sql.SQLExceptionpublic boolean relative(int row)
throws java.sql.SQLException
relative in interface java.sql.ResultSetrelative in class JtdsResultSetjava.sql.SQLExceptionpublic java.lang.String getCursorName()
throws java.sql.SQLException
getCursorName in interface java.sql.ResultSetgetCursorName in class JtdsResultSetjava.sql.SQLExceptionGenerated on June 8 2013