|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.jtds.jdbc.JtdsResultSet | +--net.sourceforge.jtds.jdbc.CachedResultSet
A memory cached scrollable/updateable result set.
Notes:
Field Summary | |
protected ConnectionJDBC2 |
connection
The parent connection object |
protected TdsCore |
cursorTds
Cursor TdsCore object. |
protected int |
initialRowCnt
The row count of the initial result set. |
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. |
Fields inherited from class net.sourceforge.jtds.jdbc.JtdsResultSet |
cancelled, CLOSE_CURSORS_AT_COMMIT, closed, columnCount, columnMap, columns, concurrency, currentRow, cursorName, direction, f, fetchDirection, fetchSize, HOLD_CURSORS_OVER_COMMIT, INITIAL_ROW_COUNT, pos, POS_AFTER_LAST, POS_BEFORE_FIRST, resultSetType, rowData, rowPtr, rowsInResult, statement, wasNull |
Fields inherited from interface java.sql.ResultSet |
CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE |
Constructor Summary | |
(package private) |
CachedResultSet(JtdsResultSet rs,
boolean load)
Creates a cached result set with the same columns (and optionally data) as an existing result set. |
(package private) |
CachedResultSet(JtdsStatement statement,
ColInfo[] columns,
java.lang.Object[] data)
Creates a cached result set containing one row. |
(package private) |
CachedResultSet(JtdsStatement statement,
java.lang.String[] colName,
int[] colType)
Constructs a cached result set based on locally generated data. |
(package private) |
CachedResultSet(JtdsStatement statement,
java.lang.String sql,
java.lang.String procName,
ParamInfo[] procedureParams,
int resultSetType,
int concurrency)
Constructs a new cached result set. |
Method Summary | |
boolean |
absolute(int row)
|
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.StringBuffer 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()
|
Methods inherited from class java.lang.Object |
|
Field Detail |
protected boolean onInsertRow
protected ParamInfo[] insertRow
protected ParamInfo[] updateRow
protected boolean rowUpdated
protected boolean rowDeleted
protected int initialRowCnt
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 ConnectionJDBC2 connection
Constructor Detail |
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 occursMethod Detail |
void setConcurrency(int concurrency)
concurrency
- the concurrency value eg
ResultSet.CONCUR_READ_ONLY
private 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 keyed
private 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
protected 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
objectprotected java.lang.Object setColValue(int colIndex, int jdbcType, java.lang.Object value, int length) throws java.sql.SQLException
setColValue
in class JtdsResultSet
colIndex
- index of the columnvalue
- new column valueParamInfo[] buildWhereClause(java.lang.StringBuffer 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
public void setFetchSize(int size) throws java.sql.SQLException
setFetchSize
in class JtdsResultSet
public void afterLast() throws java.sql.SQLException
afterLast
in class JtdsResultSet
public void beforeFirst() throws java.sql.SQLException
beforeFirst
in class JtdsResultSet
public void cancelRowUpdates() throws java.sql.SQLException
cancelRowUpdates
in class JtdsResultSet
public void close() throws java.sql.SQLException
close
in class JtdsResultSet
public void deleteRow() throws java.sql.SQLException
deleteRow
in class JtdsResultSet
public void insertRow() throws java.sql.SQLException
insertRow
in class JtdsResultSet
public void moveToCurrentRow() throws java.sql.SQLException
moveToCurrentRow
in class JtdsResultSet
public void moveToInsertRow() throws java.sql.SQLException
moveToInsertRow
in class JtdsResultSet
public void refreshRow() throws java.sql.SQLException
refreshRow
in class JtdsResultSet
public void updateRow() throws java.sql.SQLException
updateRow
in class JtdsResultSet
public boolean first() throws java.sql.SQLException
first
in class JtdsResultSet
public boolean isLast() throws java.sql.SQLException
isLast
in class JtdsResultSet
public boolean last() throws java.sql.SQLException
last
in class JtdsResultSet
public boolean next() throws java.sql.SQLException
next
in class JtdsResultSet
public boolean previous() throws java.sql.SQLException
previous
in class JtdsResultSet
public boolean rowDeleted() throws java.sql.SQLException
rowDeleted
in class JtdsResultSet
public boolean rowInserted() throws java.sql.SQLException
rowInserted
in class JtdsResultSet
public boolean rowUpdated() throws java.sql.SQLException
rowUpdated
in class JtdsResultSet
public boolean absolute(int row) throws java.sql.SQLException
absolute
in class JtdsResultSet
public boolean relative(int row) throws java.sql.SQLException
relative
in class JtdsResultSet
public java.lang.String getCursorName() throws java.sql.SQLException
getCursorName
in class JtdsResultSet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |