| java.lang.Object net.sourceforge.jtds.jdbc.JtdsResultSet
All known Subclasses: net.sourceforge.jtds.jdbc.CachedResultSet, net.sourceforge.jtds.jdbc.MSCursorResultSet,
JtdsResultSet | public class JtdsResultSet implements ResultSet(Code) | | jTDS Implementation of the java.sql.ResultSet interface supporting forward read
only result sets.
Implementation notes:
- This class is also the base for more sophisticated result sets and
incorporates the update methods required by them.
- The class supports the BLOB/CLOB objects added by Brian.
author: Mike Hutchinson version: $Id: JtdsResultSet.java,v 1.46 2005/09/26 18:21:09 ddkilzer Exp $ |
Constructor Summary | |
| JtdsResultSet(JtdsStatement statement, int resultSetType, int concurrency, ColInfo[] columns) Construct a simple result set from a statement, metadata or generated keys. |
Method Summary | |
public boolean | absolute(int row) | public void | afterLast() | public void | beforeFirst() | protected void | cacheResultSetRows() Cache the remaining results to free up connection. | public void | cancelRowUpdates() | protected void | checkOpen() Check that this connection is still open. | protected void | checkScrollable() Check that this resultset is scrollable. | protected void | checkUpdateable() Check that this resultset is updateable. | public void | clearWarnings() | public void | close() | protected ColInfo[] | copyInfo(ColInfo[] info) Copy an existing result set column descriptor array.
Parameters: info - The result set column descriptors to copy. | protected Object[] | copyRow(Object[] row) Copy an existing result set row. | public void | deleteRow() | public int | findColumn(String columnName) | public boolean | first() | public Array | getArray(int columnIndex) | public Array | getArray(String columnName) | public InputStream | getAsciiStream(int columnIndex) | public InputStream | getAsciiStream(String columnName) | public BigDecimal | getBigDecimal(int columnIndex) | public BigDecimal | getBigDecimal(int columnIndex, int scale) | public BigDecimal | getBigDecimal(String columnName) | public BigDecimal | getBigDecimal(String columnName, int scale) | public InputStream | getBinaryStream(int columnIndex) | public InputStream | getBinaryStream(String columnName) | public Blob | getBlob(int columnIndex) | public Blob | getBlob(String columnName) | public boolean | getBoolean(int columnIndex) | public boolean | getBoolean(String columnName) | public byte | getByte(int columnIndex) | public byte | getByte(String columnName) | public byte[] | getBytes(int columnIndex) | public byte[] | getBytes(String columnName) | public Reader | getCharacterStream(int columnIndex) | public Reader | getCharacterStream(String columnName) | public Clob | getClob(int columnIndex) | public Clob | getClob(String columnName) | protected Object | getColumn(int index) Get the specified column's data item. | protected static int | getColumnCount(ColInfo[] columns) | protected ColInfo[] | getColumns() Retrieve the column descriptor array. | public int | getConcurrency() | protected Object[] | getCurrentRow() Retrieve the current row data. | public String | getCursorName() | public Date | getDate(int columnIndex) | public Date | getDate(String columnName) | public Date | getDate(int columnIndex, Calendar cal) | public Date | getDate(String columnName, Calendar cal) | public double | getDouble(int columnIndex) | public double | getDouble(String columnName) | public int | getFetchDirection() | public int | getFetchSize() | public float | getFloat(int columnIndex) | public float | getFloat(String columnName) | public int | getInt(int columnIndex) | public int | getInt(String columnName) | public long | getLong(int columnIndex) | public long | getLong(String columnName) | public ResultSetMetaData | getMetaData() | public Object | getObject(int columnIndex) | public Object | getObject(String columnName) | public Object | getObject(int columnIndex, Map map) | public Object | getObject(String columnName, Map map) | public Ref | getRef(int columnIndex) | public Ref | getRef(String columnName) | public int | getRow() | public short | getShort(int columnIndex) | public short | getShort(String columnName) | public Statement | getStatement() | public String | getString(int columnIndex) | public String | getString(String columnName) | public Time | getTime(int columnIndex) | public Time | getTime(String columnName) | public Time | getTime(int columnIndex, Calendar cal) | public Time | getTime(String columnName, Calendar cal) | public Timestamp | getTimestamp(int columnIndex) | public Timestamp | getTimestamp(String columnName) | public Timestamp | getTimestamp(int columnIndex, Calendar cal) | public Timestamp | getTimestamp(String columnName, Calendar cal) | public int | getType() | public URL | getURL(int columnIndex) | public URL | getURL(String columnName) | public InputStream | getUnicodeStream(int columnIndex) | public InputStream | getUnicodeStream(String columnName) | public SQLWarning | getWarnings() | public void | insertRow() | public boolean | isAfterLast() | public boolean | isBeforeFirst() | public boolean | isFirst() | public boolean | isLast() | public boolean | last() | public void | moveToCurrentRow() | public void | moveToInsertRow() | protected Object[] | newRow() Create a new row containing empty data items. | public boolean | next() | protected static void | notImplemented(String method) Report that user tried to call a method which has not been implemented. | public boolean | previous() | public void | refreshRow() | public boolean | relative(int row) | public boolean | rowDeleted() | public boolean | rowInserted() | public boolean | rowUpdated() | protected void | setColLabel(int colIndex, String name) Set the specified column's label. | protected void | setColName(int colIndex, String name) Set the specified column's name. | protected void | setColType(int colIndex, int jdbcType) Set the specified column's JDBC type. | protected Object | setColValue(int colIndex, int jdbcType, Object value, int length) Set the specified column's data value. | protected void | setColumnCount(int columnCount) Set the current row's column count. | public void | setFetchDirection(int direction) | public void | setFetchSize(int rows) | public void | updateArray(int columnIndex, Array x) | public void | updateArray(String columnName, Array x) | public void | updateAsciiStream(int columnIndex, InputStream inputStream, int length) | public void | updateAsciiStream(String columnName, InputStream x, int length) | public void | updateBigDecimal(int columnIndex, BigDecimal x) | public void | updateBigDecimal(String columnName, BigDecimal x) | public void | updateBinaryStream(int columnIndex, InputStream inputStream, int length) | public void | updateBinaryStream(String columnName, InputStream x, int length) | public void | updateBlob(int columnIndex, Blob x) | public void | updateBlob(String columnName, Blob x) | public void | updateBoolean(int columnIndex, boolean x) | public void | updateBoolean(String columnName, boolean x) | public void | updateByte(int columnIndex, byte x) | public void | updateByte(String columnName, byte x) | public void | updateBytes(int columnIndex, byte[] x) | public void | updateBytes(String columnName, byte[] x) | public void | updateCharacterStream(int columnIndex, Reader reader, int length) | public void | updateCharacterStream(String columnName, Reader x, int length) | public void | updateClob(int columnIndex, Clob x) | public void | updateClob(String columnName, Clob x) | public void | updateDate(int columnIndex, Date x) | public void | updateDate(String columnName, Date x) | public void | updateDouble(int columnIndex, double x) | public void | updateDouble(String columnName, double x) | public void | updateFloat(int columnIndex, float x) | public void | updateFloat(String columnName, float x) | public void | updateInt(int columnIndex, int x) | public void | updateInt(String columnName, int x) | public void | updateLong(int columnIndex, long x) | public void | updateLong(String columnName, long x) | public void | updateNull(int columnIndex) | public void | updateNull(String columnName) | public void | updateObject(int columnIndex, Object x) | public void | updateObject(int columnIndex, Object x, int scale) | public void | updateObject(String columnName, Object x) | public void | updateObject(String columnName, Object x, int scale) | public void | updateRef(int columnIndex, Ref x) | public void | updateRef(String columnName, Ref x) | public void | updateRow() | public void | updateShort(int columnIndex, short x) | public void | updateShort(String columnName, short x) | public void | updateString(int columnIndex, String x) | public void | updateString(String columnName, String x) | public void | updateTime(int columnIndex, Time x) | public void | updateTime(String columnName, Time x) | public void | updateTimestamp(int columnIndex, Timestamp x) | public void | updateTimestamp(String columnName, Timestamp x) | public boolean | wasNull() |
CLOSE_CURSORS_AT_COMMIT | final static int CLOSE_CURSORS_AT_COMMIT(Code) | | |
HOLD_CURSORS_OVER_COMMIT | final static int HOLD_CURSORS_OVER_COMMIT(Code) | | |
INITIAL_ROW_COUNT | final protected static int INITIAL_ROW_COUNT(Code) | | Initial size for row array.
|
POS_AFTER_LAST | final protected static int POS_AFTER_LAST(Code) | | |
POS_BEFORE_FIRST | final protected static int POS_BEFORE_FIRST(Code) | | |
cancelled | protected boolean cancelled(Code) | | True if the query has been cancelled by another thread.
|
closed | protected boolean closed(Code) | | True if this result set is closed.
|
columnCount | protected int columnCount(Code) | | Number of visible columns in row.
|
columns | protected ColInfo[] columns(Code) | | The array of column descriptors.
|
concurrency | protected int concurrency(Code) | | The result set concurrency.
|
currentRow | protected Object[] currentRow(Code) | | The current result set row.
|
cursorName | protected String cursorName(Code) | | The cursor name to be used for positioned updates.
|
direction | protected int direction(Code) | | The fetch direction.
|
fetchDirection | protected int fetchDirection(Code) | | The fetch direction.
|
fetchSize | protected int fetchSize(Code) | | The fetch size (only applies to cursor ResultSet s).
|
pos | protected int pos(Code) | | The current row number.
|
resultSetType | protected int resultSetType(Code) | | The result set type.
|
rowData | protected ArrayList rowData(Code) | | Cached row data for forward only result set.
|
rowPtr | protected int rowPtr(Code) | | Index of current row in rowData.
|
rowsInResult | protected int rowsInResult(Code) | | The number of rows in the result.
|
wasNull | protected boolean wasNull(Code) | | True if last column retrieved was null.
|
JtdsResultSet | JtdsResultSet(JtdsStatement statement, int resultSetType, int concurrency, ColInfo[] columns) throws SQLException(Code) | | Construct a simple result set from a statement, metadata or generated keys.
Parameters: statement - The parent statement object or null. Parameters: resultSetType - one of FORWARD_ONLY, SCROLL_INSENSITIVE, SCROLL_SENSITIVE. Parameters: concurrency - One of CONCUR_READ_ONLY, CONCUR_UPDATE. Parameters: columns - The array of column descriptors for the result set row. throws: SQLException - |
cacheResultSetRows | protected void cacheResultSetRows() throws SQLException(Code) | | Cache the remaining results to free up connection.
throws: SQLException - |
checkScrollable | protected void checkScrollable() throws SQLException(Code) | | Check that this resultset is scrollable.
throws: SQLException - if connection closed. |
checkUpdateable | protected void checkUpdateable() throws SQLException(Code) | | Check that this resultset is updateable.
throws: SQLException - if connection closed. |
copyInfo | protected ColInfo[] copyInfo(ColInfo[] info)(Code) | | Copy an existing result set column descriptor array.
Parameters: info - The result set column descriptors to copy. The new descriptors as a ColInfo[] . |
copyRow | protected Object[] copyRow(Object[] row)(Code) | | Copy an existing result set row.
Parameters: row - the result set row to copy the new row as an Object array |
getColumn | protected Object getColumn(int index) throws SQLException(Code) | | Get the specified column's data item.
Parameters: index - the column index in the row the column value as an Object throws: SQLException - if the connection is closed;if index is less than 1 ;if index is greater that the number of columns;if there is no current row |
getColumnCount | protected static int getColumnCount(ColInfo[] columns)(Code) | | Retrieve the column count excluding hidden columns
Parameters: columns - The columns array The new column count as an int . |
getColumns | protected ColInfo[] getColumns()(Code) | | Retrieve the column descriptor array.
The column descriptors as a ColInfo[] . |
getCurrentRow | protected Object[] getCurrentRow()(Code) | | Retrieve the current row data.
The current row data as an Object[] . |
newRow | protected Object[] newRow()(Code) | | Create a new row containing empty data items.
the new row as an Object array |
notImplemented | protected static void notImplemented(String method) throws SQLException(Code) | | Report that user tried to call a method which has not been implemented.
Parameters: method - The method name to report in the error message. throws: SQLException - |
setColLabel | protected void setColLabel(int colIndex, String name)(Code) | | Set the specified column's label.
Parameters: colIndex - The index of the column in the row. Parameters: name - The new label. |
setColName | protected void setColName(int colIndex, String name)(Code) | | Set the specified column's name.
Parameters: colIndex - The index of the column in the row. Parameters: name - The new name. |
setColType | protected void setColType(int colIndex, int jdbcType)(Code) | | Set the specified column's JDBC type.
Parameters: colIndex - The index of the column in the row. Parameters: jdbcType - The new type value. |
setColValue | protected Object setColValue(int colIndex, int jdbcType, Object value, int length) throws SQLException(Code) | | Set the specified column's data value.
Parameters: colIndex - index of the column Parameters: value - new column value Parameters: length - the length of a stream parameter the value, possibly converted to an internal type |
setColumnCount | protected void setColumnCount(int columnCount)(Code) | | Set the current row's column count.
Parameters: columnCount - The number of visible columns in the row. |
updateBoolean | public void updateBoolean(int columnIndex, boolean x) throws SQLException(Code) | | |
updateCharacterStream | public void updateCharacterStream(int columnIndex, Reader reader, int length) throws SQLException(Code) | | |
|
|