|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.jtds.jdbc.JtdsResultSet
net.sourceforge.jtds.jdbc.MSCursorResultSet
public class MSCursorResultSet
This class extends the JtdsResultSet to support scrollable and or updateable cursors on Microsoft servers.
The undocumented Microsoft sp_cursor procedures are used.
Implementation notes:
| Field Summary | |
|---|---|
private boolean |
asyncCursor
The cursor is being built asynchronously. |
private static int |
CURSOR_CONCUR_OPTIMISTIC
|
private static int |
CURSOR_CONCUR_OPTIMISTIC_VALUES
|
private static int |
CURSOR_CONCUR_READ_ONLY
|
private static int |
CURSOR_CONCUR_SCROLL_LOCKS
|
private static java.lang.Integer |
CURSOR_OP_DELETE
|
private static java.lang.Integer |
CURSOR_OP_INSERT
|
private static java.lang.Integer |
CURSOR_OP_UPDATE
|
private static int |
CURSOR_TYPE_AUTO_FETCH
|
private static int |
CURSOR_TYPE_DYNAMIC
|
private static int |
CURSOR_TYPE_FASTFORWARDONLY
|
private static int |
CURSOR_TYPE_FORWARD
|
private static int |
CURSOR_TYPE_KEYSET
|
private static int |
CURSOR_TYPE_PARAMETERIZED
|
private static int |
CURSOR_TYPE_STATIC
|
private int |
cursorPos
Actual position of the cursor. |
private static java.lang.Integer |
FETCH_ABSOLUTE
|
private static java.lang.Integer |
FETCH_FIRST
|
private static java.lang.Integer |
FETCH_INFO
|
private static java.lang.Integer |
FETCH_LAST
|
private static java.lang.Integer |
FETCH_NEXT
|
private static java.lang.Integer |
FETCH_PREVIOUS
|
private static java.lang.Integer |
FETCH_RELATIVE
|
private static java.lang.Integer |
FETCH_REPEAT
|
private ParamInfo[] |
insertRow
The "insert row". |
private boolean |
onInsertRow
Set when moveToInsertRow() was called. |
private ParamInfo |
PARAM_CURSOR_HANDLE
Cursor handle parameter. |
private ParamInfo |
PARAM_FETCHTYPE
sp_cursorfetch fetchtype parameter. |
private ParamInfo |
PARAM_NUMROWS_IN
sp_cursorfetch numrows IN parameter (for actual fetches). |
private ParamInfo |
PARAM_NUMROWS_OUT
sp_cursorfetch numrows OUT parameter (for FETCH_INFO). |
private ParamInfo |
PARAM_OPTYPE
sp_cursor optype parameter. |
private ParamInfo |
PARAM_ROWNUM
sp_cursor rownum parameter. |
private ParamInfo |
PARAM_ROWNUM_IN
sp_cursorfetch rownum IN parameter (for actual fetches). |
private ParamInfo |
PARAM_ROWNUM_OUT
sp_cursorfetch rownum OUT parameter (for FETCH_INFO). |
private ParamInfo |
PARAM_TABLE
sp_cursor table parameter. |
private java.lang.Object[][] |
rowCache
The row cache used instead JtdsResultSet.currentRow. |
private static java.lang.Integer |
SQL_ROW_DELETED
The row has been deleted. |
private static java.lang.Integer |
SQL_ROW_DIRTY
The row is dirty and needs to be reloaded (internal state). |
private static java.lang.Integer |
SQL_ROW_SUCCESS
The row is valid. |
private ParamInfo[] |
updateRow
The "update row". |
| Fields inherited from class net.sourceforge.jtds.jdbc.JtdsResultSet |
|---|
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 |
| 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 | |
|---|---|
MSCursorResultSet(JtdsStatement statement,
java.lang.String sql,
java.lang.String procName,
ParamInfo[] procedureParams,
int resultSetType,
int concurrency)
Construct a cursor result set using Microsoft sp_cursorcreate etc. |
|
| Method Summary | |
|---|---|
boolean |
absolute(int row)
|
void |
afterLast()
|
void |
beforeFirst()
|
void |
cancelRowUpdates()
|
void |
close()
|
private void |
cursor(java.lang.Integer opType,
ParamInfo[] row)
Support general cursor operations such as delete, update etc. |
private void |
cursorClose()
Close a server side cursor. |
private void |
cursorCreate(java.lang.String sql,
java.lang.String procName,
ParamInfo[] parameters)
Create a new Cursor result set using the internal sp_cursoropen procedure. |
private boolean |
cursorFetch(java.lang.Integer fetchType,
int rowNum)
Fetch the next result row from a cursor using the internal sp_cursorfetch procedure. |
void |
deleteRow()
|
boolean |
first()
|
protected java.lang.Object |
getColumn(int index)
Get the specified column's data item. |
protected java.lang.Object[] |
getCurrentRow()
Retrieve the current row data. |
(package private) static int |
getCursorConcurrencyOpt(int resultSetConcurrency)
Translates a JDBC result set concurrency into SQL Server native @ccOpt value for use with stored procedures such as sp_cursoropen, sp_cursorprepare or sp_cursorprepexec. |
(package private) static int |
getCursorScrollOpt(int resultSetType,
int resultSetConcurrency,
boolean parameterized)
Translates a JDBC result set type into SQL Server native @scrollOpt value for use with stored procedures such as sp_cursoropen, sp_cursorprepare or sp_cursorprepexec. |
void |
insertRow()
|
boolean |
isLast()
|
boolean |
last()
|
void |
moveToCurrentRow()
|
void |
moveToInsertRow()
|
boolean |
next()
|
boolean |
previous()
|
private void |
processOutput(TdsCore tds,
boolean setMeta)
Processes the output of a cursor open or fetch operation. |
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)
Set the specified column's data value. |
void |
updateRow()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.Integer FETCH_FIRST
private static final java.lang.Integer FETCH_NEXT
private static final java.lang.Integer FETCH_PREVIOUS
private static final java.lang.Integer FETCH_LAST
private static final java.lang.Integer FETCH_ABSOLUTE
private static final java.lang.Integer FETCH_RELATIVE
private static final java.lang.Integer FETCH_REPEAT
private static final java.lang.Integer FETCH_INFO
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET
private static final int CURSOR_TYPE_KEYSET