Inherits com.dbSpaces.jdb.Base.
Public Member Functions | |
boolean | absolute (int row) throws DatabaseException |
void | afterLast () throws DatabaseException |
void | beforeFirst () throws DatabaseException |
void | close () throws DatabaseException |
int | findColumn (String columnLabel) throws DatabaseException |
boolean | first () throws DatabaseException |
Object | getArray (int columnIndex, int startPosition, int length) throws DatabaseException |
ResultSet | getArrayAsResultSet (int columnIndex, int startPosition, int length) throws DatabaseException |
java.io.InputStream | getAsciiStream (int columnIndex) throws DatabaseException |
InputStream | getAsciiStream (String columnName) throws DatabaseException |
java.math.BigDecimal | getBigDecimal (int columnIndex) throws DatabaseException |
java.math.BigDecimal | getBigDecimal (String columnName) throws DatabaseException |
java.io.InputStream | getBinaryStream (int columnIndex) throws DatabaseException |
InputStream | getBinaryStream (String columnName) throws DatabaseException |
boolean | getBoolean (int columnIndex) throws DatabaseException |
boolean | getBoolean (String columnName) throws DatabaseException |
byte | getByte (int columnIndex) throws DatabaseException |
byte | getByte (String columnName) throws DatabaseException |
byte[] | getBytes (int columnIndex) throws DatabaseException |
ResultSetColumnMetaData | getColumnMetaData (int columnIndex) throws DatabaseException |
String | getCursorName () |
Date | getDate (int columnIndex) throws DatabaseException |
Date | getDate (String columnName) throws DatabaseException |
double | getDouble (int columnIndex) throws DatabaseException |
double | getDouble (String columnName) throws DatabaseException |
int | getFetchDirection () throws DatabaseException |
int | getFetchSize () throws DatabaseException |
float | getFloat (int columnIndex) throws DatabaseException |
int | getInt (int columnIndex) throws DatabaseException |
int | getInt (String columnName) throws DatabaseException |
long | getLong (int columnIndex) throws DatabaseException |
int | getNumberOfColumns () throws DatabaseException |
Object | getObject (int columnIndex) throws DatabaseException |
Object | getObject (String columnName) throws DatabaseException |
int | getRow () throws DatabaseException |
short | getShort (int columnIndex) throws DatabaseException |
short | getShort (String columnName) throws DatabaseException |
String | getString (int columnIndex) throws DatabaseException |
String | getString (String columnName) throws DatabaseException |
Time | getTime (int columnIndex) throws DatabaseException |
Time | getTime (String columnName) throws DatabaseException |
Timestamp | getTimestamp (int columnIndex) throws DatabaseException |
Timestamp | getTimestamp (String columnName) throws DatabaseException |
java.io.InputStream | getUnicodeStream (int columnIndex) throws DatabaseException |
InputStream | getUnicodeStream (String columnName) throws DatabaseException |
boolean | isAfterLast () throws DatabaseException |
boolean | isBeforeFirst () throws DatabaseException |
boolean | isClosed () |
boolean | isFirst () throws DatabaseException |
boolean | isLast () throws DatabaseException |
boolean | last () throws DatabaseException |
boolean | next () throws DatabaseException |
boolean | previous () throws DatabaseException |
boolean | relative (int relativeRow) throws DatabaseException |
dtRtnStatus | setFetchDirection (int direction) throws DatabaseException |
dtRtnStatus | setFetchSize (int rows) throws DatabaseException |
dtRtnStatus | setFetchType (int fetchType) throws DatabaseException |
boolean | wasNull () throws DatabaseException |
A ResultSet provides access to a table of data. A ResultSet object is usually generated by executing a Statement.
A ResultSet maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The 'next' method moves the cursor to the next row.
The getXXX methods retrieve column values for the current row. You can retrieve values either using the index number of the column, or by using the name of the column. In general using the column index will be more efficient. Columns are numbered from 1.
For maximum portability, ResultSet columns within each row should be read in left-to-right order and each column should be read only once.
For the getXXX methods, the API attempts to convert the underlying data to the specified Java type and returns a suitable Java value.
Column names used as input to getXXX methods are case insensitive. When performing a getXXX using a column name, if several columns have the same name, then the value of the first matching column will be returned. The column name option is designed to be used when column names are used in the SQL query. For columns that are NOT explicitly named in the query, it is best to use column numbers. If column names were used there is no way for the programmer to guarantee that they actually refer to the intended columns.
A ResultSet is automatically closed by the Statement that generated it when that Statement is closed, re-executed, or is used to retrieve the next result from a sequence of multiple results.
The number, types and properties of a ResultSet's columns are provided by the ResulSetMetaData object returned by the getMetaData method.
A DatabaseException will be thrown if a database error occurs and exceptions are enabled. If exceptions are not enabled the following error methods can be used to get information about the error;
boolean com.dbSpaces.jdb.ResultSet.absolute | ( | int | row | ) | throws DatabaseException |
Moves the cursor to the given row number in this ResultSet object.
If the row number is positive, the cursor moves to the given row number with respect to the beginning of the result set. The first row is row 1, the second is row 2, and so on.
If the given row number is negative, the cursor moves to an absolute row position with respect to the end of the result set. For example, calling the method absolute(-1)
positions the cursor on the last row; calling the method absolute(-2)
moves the cursor to the next-to-last row, and so on.
An attempt to position the cursor beyond the first/last row inthe result set leaves the cursor before the first row or after the last row.
Note: Calling absolute(1)
is the same as calling first()
. Calling absolute(-1)
is the same as calling last()
.
row | The number of the row to which the cursor should move. A positive number indicates the row number counting from the beginning of the result set; a negative number indicates the row number counting from the end of the result set |
true
if the cursor is moved to a position in this ResultSet object; false
if the cursor is before the first row or after the last row. DatabaseException | (if exceptions are enabled) when a database error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY . |
void com.dbSpaces.jdb.ResultSet.afterLast | ( | ) | throws DatabaseException |
Moves the cursor to the end of this ResultSet object, just after the last row. This method has no effect if the result set contains no rows.
SQLException | if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY |
void com.dbSpaces.jdb.ResultSet.beforeFirst | ( | ) | throws DatabaseException |
Moves the cursor to the front of this ResultSet object, just before the first row. This method has no effect if the result set contains no rows.
SQLException | if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY |
void com.dbSpaces.jdb.ResultSet.close | ( | ) | throws DatabaseException |
Releases this ResultSet object's database and local resources immediately instead of waiting for this to happen when it is automatically closed.
DatabaseException | if a database access error occurs |
int com.dbSpaces.jdb.ResultSet.findColumn | ( | String | columnLabel | ) | throws DatabaseException |
Find the given ResultSet column label to its ResultSet column index. The label for the column is specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
columnLabel | The column label to find. |
SQLException | if the ResultSet object does not contain a column Labelled columnLabel , a database access error occurs or this method is called on a closed result set |
boolean com.dbSpaces.jdb.ResultSet.first | ( | ) | throws DatabaseException |
Moves the cursor to the first row in this ResultSet object.
true
if the cursor is on a valid row; false
if there are no rows in the result set. SQLException | if a database access error occurs; this method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY |
Object com.dbSpaces.jdb.ResultSet.getArray | ( | int | columnIndex, |
int | startPosition, | ||
int | length | ||
) | throws DatabaseException |
Retrieves the value of the designated column in the current row of this ResultSet object as an Array
object.
columnIndex | The first column is 1, the second is 2, ... |
startPosition | The start postion in the multi-value, starting from 0 ... |
length | The number of multi-values to return. |
Array
object representing the SQL ARRAY
value in the specified column. DatabaseException | (if exceptions are enabled) when a database error occurs. |
ResultSet com.dbSpaces.jdb.ResultSet.getArrayAsResultSet | ( | int | columnIndex, |
int | startPosition, | ||
int | length | ||
) | throws DatabaseException |
Retrieves the value of the designated column in the current row of this ResultSet object as an ResultSet object.
columnIndex | The first column is 1, the second is 2, ... |
startPosition | The start postion in the multi-value, starting from 0 ... |
length | The number of multi-values to return. |
ARRAY
value in the specified column. DatabaseException | (if exceptions are enabled) when a database error occurs. |
java.io.InputStream com.dbSpaces.jdb.ResultSet.getAsciiStream | ( | int | columnIndex | ) | throws DatabaseException |
A column value can be retrieved as a stream of ASCII characters and then read in chunks from the stream. This method is particularly suitable for retrieving large LONGVARCHAR values. The method will do any necessary conversion from the database format into ASCII.
Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream. . Also, a stream may return 0 for available() whether there is data available or not.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
InputStream com.dbSpaces.jdb.ResultSet.getAsciiStream | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
java.math.BigDecimal com.dbSpaces.jdb.ResultSet.getBigDecimal | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a java.math.BigDecimal object.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public java math BigDecimal com.dbSpaces.jdb.ResultSet.getBigDecimal | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
java.io.InputStream com.dbSpaces.jdb.ResultSet.getBinaryStream | ( | int | columnIndex | ) | throws DatabaseException |
A column value can be retrieved as a stream of uninterpreted bytes and then read in chunks from the stream. This method is particularly suitable for retrieving large LONGVARBINARY values.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public InputStream com.dbSpaces.jdb.ResultSet.getBinaryStream | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
boolean com.dbSpaces.jdb.ResultSet.getBoolean | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Java boolean.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public boolean com.dbSpaces.jdb.ResultSet.getBoolean | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
byte com.dbSpaces.jdb.ResultSet.getByte | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Java byte.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public byte com.dbSpaces.jdb.ResultSet.getByte | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
byte[] com.dbSpaces.jdb.ResultSet.getBytes | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Java byte array. The bytes represent the raw values returned by the driver.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
ResultSetColumnMetaData com.dbSpaces.jdb.ResultSet.getColumnMetaData | ( | int | columnIndex | ) | throws DatabaseException |
Get the ResultSetColumnMetaData object for the column index provided.
columnNumber | The column to get meta data for, starts from 1. |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
String com.dbSpaces.jdb.ResultSet.getCursorName | ( | ) |
Get the cursor name for the ResultSet object.
Date com.dbSpaces.jdb.ResultSet.getDate | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Date object.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public Date com.dbSpaces.jdb.ResultSet.getDate | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
double com.dbSpaces.jdb.ResultSet.getDouble | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Java double.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public double com.dbSpaces.jdb.ResultSet.getDouble | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
int com.dbSpaces.jdb.ResultSet.getFetchDirection | ( | ) | throws DatabaseException |
Retrieves the fetch direction for this ResultSet object.
DatabaseException | (if exceptions are enabled) when a database error occurs. |
int com.dbSpaces.jdb.ResultSet.getFetchSize | ( | ) | throws DatabaseException |
Get the fetch size for this ResultSet object.
DatabaseException | (if exceptions are enabled) when a database error occurs. |
float com.dbSpaces.jdb.ResultSet.getFloat | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Java float.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
int com.dbSpaces.jdb.ResultSet.getInt | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Java int.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public long com.dbSpaces.jdb.ResultSet.getInt | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
long com.dbSpaces.jdb.ResultSet.getLong | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Java long.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
int com.dbSpaces.jdb.ResultSet.getNumberOfColumns | ( | ) | throws DatabaseException |
Get the number of columns that exist for this ResultSet object.
DatabaseException | (if exceptions are enabled) when a database error occurs. |
Object com.dbSpaces.jdb.ResultSet.getObject | ( | int | columnIndex | ) | throws DatabaseException |
Gets the value of the designated column in the current row of this ResultSet object as an Object
in the Java programming language.
This method will return the value of the given column as a Java object. The type of the Java object will be the default Java object type corresponding to the column's SQL type, following the mapping for built-in types specified in the JDBC specification. If the value is an SQL NULL
, the driver returns a Java null
.
This method may also be used to read database-specific abstract data types.
columnIndex | The first column is 1, the second is 2, ... |
java.lang.Object
holding the column value. DatabaseException | (if exceptions are enabled) when a database error occurs. |
public String com.dbSpaces.jdb.ResultSet.getObject | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
int com.dbSpaces.jdb.ResultSet.getRow | ( | ) | throws DatabaseException |
Retrieves the current row number. The first row is number 1, the second number 2, and so on.
getRow
method is optional for ResultSets with a result set type of TYPE_FORWARD_ONLY
.0
if there is no current row. DatabaseException | (if exceptions are enabled) when a database error occurs. |
short com.dbSpaces.jdb.ResultSet.getShort | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Java short.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | if a database-access error occurs. |
public short com.dbSpaces.jdb.ResultSet.getShort | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
String com.dbSpaces.jdb.ResultSet.getString | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Java String.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public String com.dbSpaces.jdb.ResultSet.getString | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Time com.dbSpaces.jdb.ResultSet.getTime | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Time object.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public Time com.dbSpaces.jdb.ResultSet.getTime | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Timestamp com.dbSpaces.jdb.ResultSet.getTimestamp | ( | int | columnIndex | ) | throws DatabaseException |
Get the value of a column in the current row as a Timestamp object.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public Timestamp com.dbSpaces.jdb.ResultSet.getTimestamp | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
java.io.InputStream com.dbSpaces.jdb.ResultSet.getUnicodeStream | ( | int | columnIndex | ) | throws DatabaseException |
A column value can be retrieved as a stream of Unicode characters and then read in chunks from the stream. This method is particularly suitable for retrieving large LONGVARCHAR values. The method will do any necessary conversion from the database format into Unicode.
columnIndex | The first column is 1, the second is 2, ... |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
public InputStream com.dbSpaces.jdb.ResultSet.getUnicodeStream | ( | String | columnName | ) | throws DatabaseException |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
boolean com.dbSpaces.jdb.ResultSet.isAfterLast | ( | ) | throws DatabaseException |
Retrieves whether the cursor is after the last row in this ResultSet object.
isAfterLast
method is optional for ResultSets with a result set type of TYPE_FORWARD_ONLY
.true
if the cursor is after the last row; false
if the cursor is at any other position or the result set contains no rows. DatabaseException | (if exceptions are enabled) when a database error occurs. |
boolean com.dbSpaces.jdb.ResultSet.isBeforeFirst | ( | ) | throws DatabaseException |
Retrieves whether the cursor is before the first row in this ResultSet object.
isBeforeFirst
method is optional for ResultSets with a result set type of TYPE_FORWARD_ONLY
.true
if the cursor is before the first row; false
if the cursor is at any other position or the result set contains no rows. DatabaseException | (if exceptions are enabled) when a database error occurs. |
boolean com.dbSpaces.jdb.ResultSet.isClosed | ( | ) |
Retrieves whether this ResultSet object has been closed. A ResultSet is closed if the method close has been called on it, or if it is automatically closed.
true if this ResultSet object is closed; false
if it is still open.
Version 1.0
boolean com.dbSpaces.jdb.ResultSet.isFirst | ( | ) | throws DatabaseException |
Retrieves whether the cursor is on the first row of this ResultSet object.
isFirst
method is optional for ResultSets with a result set type of TYPE_FORWARD_ONLY
.true
if the cursor is on the first row; false
if otherwise. DatabaseException | (if exceptions are enabled) when a database error occurs. |
boolean com.dbSpaces.jdb.ResultSet.isLast | ( | ) | throws DatabaseException |
Retrieves whether the cursor is on the last row of this ResultSet object. Note: Calling the method isLast
may be expensive because the JDBC driver might need to fetch ahead one row in order to determine whether the current row is the last row in the result set.
isLast
method is optional for ResultSets with a result set type of TYPE_FORWARD_ONLY
.true
if the cursor is on the last row; false
if otherwise. DatabaseException | (if exceptions are enabled) when a database error occurs. |
boolean com.dbSpaces.jdb.ResultSet.last | ( | ) | throws DatabaseException |
Moves the cursor to the last row in this ResultSet object.
true
if the cursor is on a valid row; false
if there are no rows in the result set. DatabaseException | (if exceptions are enabled) when a database error occurs. |
boolean com.dbSpaces.jdb.ResultSet.next | ( | ) | throws DatabaseException |
A ResultSet is initially positioned before its first row; the first call to next makes the first row the current row; the second call makes the second row the current row, etc.
true
if the new current row is valid; false
if there are no more rows. DatabaseException | (if exceptions are enabled) when a database error occurs. |
boolean com.dbSpaces.jdb.ResultSet.previous | ( | ) | throws DatabaseException |
Moves the cursor to the previous row in this ResultSet object.
When a call to the previous
method returns false
, the cursor is positioned before the first row. Any invocation of a ResultSet method which requires a current row will result in a DatabaseException
being thrown.
If an input stream is open for the current row, a call to the method previous
will implicitly close it. A ResultSet object's warning change is cleared when a new row is read.
true
if the cursor is now positioned on a valid row; false
if the cursor is positioned before the first row. DatabaseException | (if exceptions are enabled) when a database error occurs. |
boolean com.dbSpaces.jdb.ResultSet.relative | ( | int | relativeRow | ) | throws DatabaseException |
Moves the cursor a relative number of rows, either positive or negative. Attempting to move beyond the first/last row in the result set positions the cursor before/after the the first/last row. Calling relative(0)
is valid, but does not change the cursor position.
Note: Calling the method relative(1)
is identical to calling the method next()
and calling the method relative(-1)
is identical to calling the method previous()
.
rows | An int specifying the number of rows to move from the current row; a positive number moves the cursor forward; a negative number moves the cursor backward |
true
if the cursor is on a row; false
if otherwise. DatabaseException | (if exceptions are enabled) when a database error occurs. |
dtRtnStatus com.dbSpaces.jdb.ResultSet.setFetchDirection | ( | int | direction | ) | throws DatabaseException |
Give a hint as to the direction in which the rows in this result set will be processed. The initial value is determined by the statement that produced the result set. The fetch direction may be changed at any time.
direction | The fetch direction. |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
dtRtnStatus com.dbSpaces.jdb.ResultSet.setFetchSize | ( | int | rows | ) | throws DatabaseException |
Gives a hint as to the number of rows that should be fetched from the database when more rows are needed for this ResultSet object.
If the fetch size specified is zero, the value is ignored. The default value is set by theStatement object that created the result set. The fetch size may be changed at any time.
rows | The number of rows to fetch. |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
dtRtnStatus com.dbSpaces.jdb.ResultSet.setFetchType | ( | int | fetchType | ) | throws DatabaseException |
Set the fetch type for the ResultSet object. The supported fetch types currently supported are; RESULTSET_TYPE_FORWARD_ONLY - cursor can move forward only RESULTSET_TYPE_SCROLL_INSENSITIVE - cursor can move in any direction
The default fetch type for the ResultSet object is forward only.
fetchType | The new fetch type. |
DatabaseException | (if exceptions are enabled) when a database error occurs. |
boolean com.dbSpaces.jdb.ResultSet.wasNull | ( | ) | throws DatabaseException |
Reports whether the last column read had a value of SQL NULL
. Note that you must first call one of the getter methods on a column to try to read its value and then callthe method wasNull
to see if the value read was SQL NULL
.
true
if the last column value read was SQL NULL
and false
if otherwise. DatabaseException | (if exceptions are enabled) when a database error occurs. |