Interface ResultSet
- All Superinterfaces:
AutoCloseable,Wrapper
- All Known Subinterfaces:
RowSet
- All Known Implementing Classes:
JDBCResultSet
public interface ResultSet extends Wrapper, AutoCloseable
ResultSets have a cursor which points to the current data table row.
When the ResultSet is created, the cursor's location is one position
ahead of the first row. To move the cursor to the first and consecutive rows,
use the next method. The next method returns true as
long as there are more rows in the ResultSet, otherwise it returns
false.
The default type of ResultSet can not be updated and its cursor can
only advance forward through the rows of data. This means that it is only
possible to read through it once. However, other kinds of ResultSet
are implemented: an updatable type and also types where the cursor can
be scrolled forward and backward through the rows of data. How such a
ResultSet is created is demonstrated in the following example:
-
Connection con; Statement aStatement = con.createStatement( ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE );ResultSet theResultSet = theStatement.executeQuery("SELECT price, quantity FROM STOCKTABLE");// theResultSet is both scrollable and updatable
The ResultSet interface provides a series of methods for retrieving
data from columns in the current row, such as getDate and
getFloat. The columns are retrieved either by their index number (starting
at 1) or by their name - there are separate methods for both techniques of
column addressing. The column names are case insensitive. If several columns
have the same name, then the getter methods use the first matching column.
This means that if column names are used, it is not possible to guarantee
that the name will retrieve data from the intended column - for certainty it
is better to use column indexes. Ideally the columns should be read
left-to-right and read once only, since not all databases are optimized to
handle other techniques of reading the data.
When reading data via the appropriate getter methods, the JDBC driver maps the SQL data retrieved from the database to the Java type implied by the method invoked by the application. The JDBC specification has a table for the mappings from SQL types to Java types.
There are also methods for writing data into the ResultSet, such as
updateInt and updateString. The update methods can be used
either to modify the data of an existing row or to insert new data rows into
the ResultSet . Modification of existing data involves moving the
cursor to the row which needs modification and then using the update methods
to modify the data, followed by calling the ResultSet.updateRow
method. For insertion of new rows, the cursor is first moved to a special row
called the Insert Row, data is added using the update methods,
followed by calling the ResultSet.insertRow method.
A ResultSet is closed if the statement which generated it closes, the
statement is executed again, or the same statement's next ResultSet
is retrieved (if the statement returned of multiple results).
-
Field Summary
Fields Modifier and Type Field Description static intCLOSE_CURSORS_AT_COMMITA constant used to indicate that aResultSetobject must be closed when the methodConnection.commitis invoked.static intCONCUR_READ_ONLYA constant used to indicate the concurrency mode for aResultSetobject that cannot be updated.static intCONCUR_UPDATABLEA constant used to indicate the concurrency mode for aResultSetobject that can be updated.static intFETCH_FORWARDA constant used to indicate processing of the rows of aResultSetin the forward direction, first to last.static intFETCH_REVERSEA constant used to indicate processing of the rows of aResultSetin the reverse direction, last to first.static intFETCH_UNKNOWNA constant used to indicate that the order of processing of the rows of aResultSetis unknown.static intHOLD_CURSORS_OVER_COMMITA constant used to indicate that aResultSetobject must not be closed when the methodConnection.commitis invoked.static intTYPE_FORWARD_ONLYA constant used to indicate aResultSetobject whose cursor can only move forward.static intTYPE_SCROLL_INSENSITIVEA constant used to indicate aResultSetobject which is scrollable but is insensitive to changes made by others.static intTYPE_SCROLL_SENSITIVEA constant used to indicate aResultSetobject which is scrollable and sensitive to changes made by others. -
Method Summary
Modifier and Type Method Description booleanabsolute(int row)Moves the cursor to a specified row number in theResultSet.voidafterLast()Moves the cursor to the end of theResultSet, after the last row.voidbeforeFirst()Moves the cursor to the start of theResultSet, before the first row.voidcancelRowUpdates()Cancels any updates made to the current row in theResultSet.voidclearWarnings()Clears all warnings related to thisResultSet.voidclose()Releases thisResultSet's database and JDBC resources.voiddeleteRow()Deletes the current row from theResultSetand from the underlying database.intfindColumn(String columnName)Gets the index number for a column in theResultSetfrom the provided column name.booleanfirst()Shifts the cursor position to the first row in theResultSet.ArraygetArray(int columnIndex)Gets the content of a column specified by column index in the current row of thisResultSetas ajava.sql.Array.ArraygetArray(String colName)Gets the value of a column specified by column name as ajava.sql.Array.InputStreamgetAsciiStream(int columnIndex)Gets the value of a column specified by column index as an ASCII character stream.InputStreamgetAsciiStream(String columnName)Gets the value of a column specified by column name as an ASCII character stream.BigDecimalgetBigDecimal(int columnIndex)Gets the value of a column specified by column index as ajava.math.BigDecimal.BigDecimalgetBigDecimal(int columnIndex, int scale)Deprecated.BigDecimalgetBigDecimal(String columnName)Gets the value of a column specified by column name, as ajava.math.BigDecimal.BigDecimalgetBigDecimal(String columnName, int scale)Deprecated.UsegetBigDecimal(int)orgetBigDecimal(String)instead.InputStreamgetBinaryStream(int columnIndex)Gets the value of a column specified by column index as a binary stream.InputStreamgetBinaryStream(String columnName)Gets the value of a column specified by column name as a binary stream.BlobgetBlob(int columnIndex)Gets the value of a column specified by column index as ajava.sql.Blobobject.BlobgetBlob(String columnName)Gets the value of a column specified by column name, as ajava.sql.Blobobject.booleangetBoolean(int columnIndex)Gets the value of a column specified by column index as aboolean.booleangetBoolean(String columnName)Gets the value of a column specified by column name, as aboolean.bytegetByte(int columnIndex)Gets the value of a column specified by column index as abyte.bytegetByte(String columnName)Gets the value of a column specified by column name as abyte.byte[]getBytes(int columnIndex)Gets the value of a column specified by column index as a byte array.byte[]getBytes(String columnName)Gets the value of a column specified by column name as a byte array.ReadergetCharacterStream(int columnIndex)Gets the value of a column specified by column index as ajava.io.Readerobject.ReadergetCharacterStream(String columnName)Gets the value of a column specified by column name as ajava.io.Readerobject.ClobgetClob(int columnIndex)Gets the value of a column specified by column index as ajava.sql.Clob.ClobgetClob(String colName)Gets the value of a column specified by column name as ajava.sql.Clob.intgetConcurrency()Gets the concurrency mode of thisResultSet.StringgetCursorName()Gets the name of the SQL cursor of thisResultSet.DategetDate(int columnIndex)Gets the value of a column specified by column index as ajava.sql.Date.DategetDate(int columnIndex, Calendar cal)Gets the value of a column specified by column index as ajava.sql.Date.DategetDate(String columnName)Gets the value of a column specified by column name as ajava.sql.Date.DategetDate(String columnName, Calendar cal)Gets the value of a column specified by column name, as ajava.sql.Dateobject.doublegetDouble(int columnIndex)Gets the value of a column specified by column index as adoublevalue.doublegetDouble(String columnName)Gets the value of a column specified by column name as adoublevalue.intgetFetchDirection()Gets the direction in which rows are fetched for thisResultSetobject.intgetFetchSize()Gets the fetch size (in number of rows) for thisResultSet.floatgetFloat(int columnIndex)Gets the value of a column specified by column index as afloatvalue.floatgetFloat(String columnName)Gets the value of a column specified by column name as afloatvalue.intgetHoldability()Returns the holdability of this result set:HOLD_CURSORS_OVER_COMMITorCLOSE_CURSORS_AT_COMMIT.intgetInt(int columnIndex)Gets the value of a column specified by column index as anintvalue.intgetInt(String columnName)Gets the value of a column specified by column name, as anintvalue.longgetLong(int columnIndex)Gets the value of a column specified by column index as alongvalue.longgetLong(String columnName)Gets the value of a column specified by column name, as alongvalue.ResultSetMetaDatagetMetaData()Gets the metadata for thisResultSet.ReadergetNCharacterStream(int columnIndex)Returns aReadercorresponding to the value at the 1-basedcolumnIndex.ReadergetNCharacterStream(String columnLabel)Returns aReadercorresponding to the value in the named column.NClobgetNClob(int columnIndex)Returns anNClobcorresponding to the value at the 1-basedcolumnIndex.NClobgetNClob(String columnLabel)Returns anNClobcorresponding to the value in the named column.StringgetNString(int columnIndex)Returns aStringcorresponding to the value at the 1-basedcolumnIndex.StringgetNString(String columnLabel)Returns aStringcorresponding to the value in the named column.ObjectgetObject(int columnIndex)Gets the value of a specified column as a JavaObject.ObjectgetObject(int columnIndex, Map<String,Class<?>> map)Gets the value of a column specified by column index as a JavaObject.ObjectgetObject(String columnName)Gets the value of a specified column as a JavaObject.ObjectgetObject(String columnName, Map<String,Class<?>> map)Gets the value of a column specified by column name as a JavaObject.RefgetRef(int columnIndex)Gets the value of a column specified by column index as a Javajava.sql.Ref.RefgetRef(String colName)Gets the value of a column specified by column name as a Javajava.sql.Ref.intgetRow()Gets the number of the current row in theResultSet.RowIdgetRowId(int columnIndex)Returns aRowIdcorresponding to the SQL ROWID at the 1-basedcolumnIndex.RowIdgetRowId(String columnLabel)Returns aRowIdcorresponding to the SQL ROWID at the named column.shortgetShort(int columnIndex)Gets the value of a column specified by column index as a short value.shortgetShort(String columnName)Gets the value of a column specified by column name, as a short value.SQLXMLgetSQLXML(int columnIndex)Returns anSQLXMLcorresponding to the value at the 1-basedcolumnIndex.SQLXMLgetSQLXML(String columnLabel)Returns anSQLXMLcorresponding to the value in the named column.StatementgetStatement()Gets the statement that produced thisResultSet.StringgetString(int columnIndex)Gets the value of a column specified by column index as a String.StringgetString(String columnName)Gets the value of a column specified by column name, as a String.TimegetTime(int columnIndex)Gets the value of a column specified by column index as ajava.sql.Timevalue.TimegetTime(int columnIndex, Calendar cal)Gets the value of a column specified by column index as ajava.sql.Timevalue.TimegetTime(String columnName)Gets the value of a column specified by column name, as ajava.sql.Timevalue.TimegetTime(String columnName, Calendar cal)Gets the value of a column specified by column index, as ajava.sql.Timevalue.TimestampgetTimestamp(int columnIndex)Gets the value of a column specified by column index as ajava.sql.Timestampvalue.TimestampgetTimestamp(int columnIndex, Calendar cal)Gets the value of a column specified by column index, as ajava.sql.Timestampvalue.TimestampgetTimestamp(String columnName)Gets the value of a column specified by column name, as ajava.sql.Timestampvalue.TimestampgetTimestamp(String columnName, Calendar cal)Gets the value of a column specified by column name, as ajava.sql.Timestampvalue.intgetType()Gets the type of theResultSet.InputStreamgetUnicodeStream(int columnIndex)Deprecated.UsegetCharacterStream(int)instead.InputStreamgetUnicodeStream(String columnName)Deprecated.UsegetCharacterStream(int)instead.URLgetURL(int columnIndex)Gets the value of a column specified by column index as ajava.net.URL.URLgetURL(String columnName)Gets the value of a column specified by column name as ajava.net.URLobject.SQLWarninggetWarnings()Gets the first warning generated by calls on thisResultSet.voidinsertRow()Insert the insert row into theResultSetand into the underlying database.booleanisAfterLast()Gets if the cursor is after the last row of theResultSet.booleanisBeforeFirst()Gets if the cursor is before the first row of theResultSet.booleanisClosed()Returns true if this result set has been closed, false otherwise.booleanisFirst()Gets if the cursor is on the first row of theResultSet.booleanisLast()Gets if the cursor is on the last row of theResultSetbooleanlast()Shifts the cursor position to the last row of theResultSet.voidmoveToCurrentRow()Moves the cursor to the remembered position, namely the row that was the current row before a call tomoveToInsertRow.voidmoveToInsertRow()Moves the cursor position to the Insert Row.booleannext()Shifts the cursor position down one row in thisResultSetobject.booleanprevious()Relocates the cursor position to the preceding row in thisResultSet.voidrefreshRow()Refreshes the current row with its most up to date value in the database.booleanrelative(int rows)Moves the cursor position up or down by a specified number of rows.booleanrowDeleted()Indicates whether a row has been deleted.booleanrowInserted()Indicates whether the current row has had an insertion operation.booleanrowUpdated()Indicates whether the current row has been updated.voidsetFetchDirection(int direction)Indicates which direction (forward/reverse) will be used to process the rows of thisResultSetobject.voidsetFetchSize(int rows)Indicates the number of rows to fetch from the database when extra rows are required for thisResultSet.voidupdateArray(int columnIndex, Array x)Updates a column specified by a column index with ajava.sql.Arrayvalue.voidupdateArray(String columnName, Array x)Updates a column specified by a column name with ajava.sql.Arrayvalue.voidupdateAsciiStream(int columnIndex, InputStream x)Updates the value at the 1-basedcolumnIndex.voidupdateAsciiStream(int columnIndex, InputStream x, int length)Updates a column specified by a column index with an ASCII stream value.voidupdateAsciiStream(int columnIndex, InputStream x, long length)Updates the value at the 1-basedcolumnIndex.voidupdateAsciiStream(String columnLabel, InputStream x)Updates the value in the named column.voidupdateAsciiStream(String columnName, InputStream x, int length)Updates a column specified by a column name with an Ascii stream value.voidupdateAsciiStream(String columnLabel, InputStream x, long length)Updates the value in the named column.voidupdateBigDecimal(int columnIndex, BigDecimal x)Updates a column specified by a column index with ajava.sql.BigDecimalvalue.voidupdateBigDecimal(String columnName, BigDecimal x)Updates a column specified by a column name with ajava.sql.BigDecimalvalue.voidupdateBinaryStream(int columnIndex, InputStream x)Updates the value at the 1-basedcolumnIndex.voidupdateBinaryStream(int columnIndex, InputStream x, int length)Updates a column specified by a column index with a binary stream value.voidupdateBinaryStream(int columnIndex, InputStream x, long length)Updates the value at the 1-basedcolumnIndex.voidupdateBinaryStream(String columnLabel, InputStream x)Updates the value in the named column.voidupdateBinaryStream(String columnName, InputStream x, int length)Updates a column specified by a column name with a binary stream value.voidupdateBinaryStream(String columnLabel, InputStream x, long length)Updates the value in the named column.voidupdateBlob(int columnIndex, InputStream inputStream)Updates the value at the 1-basedcolumnIndex.voidupdateBlob(int columnIndex, InputStream inputStream, long length)Updates the value at the 1-basedcolumnIndex.voidupdateBlob(int columnIndex, Blob x)Updates a column specified by a column index with ajava.sql.Blobvalue.voidupdateBlob(String columnLabel, InputStream inputStream)Updates the value in the named column.voidupdateBlob(String columnLabel, InputStream inputStream, long length)Updates the value in the named column.voidupdateBlob(String columnName, Blob x)Updates a column specified by a column name with ajava.sql.Blobvalue.voidupdateBoolean(int columnIndex, boolean x)Updates a column specified by a column index with abooleanvalue.voidupdateBoolean(String columnName, boolean x)Updates a column specified by a column name with abooleanvalue.voidupdateByte(int columnIndex, byte x)Updates a column specified by a column index with abytevalue.voidupdateByte(String columnName, byte x)Updates a column specified by a column name with abytevalue.voidupdateBytes(int columnIndex, byte[] x)Updates a column specified by a column index with abytearray value.voidupdateBytes(String columnName, byte[] x)Updates a column specified by a column name with a byte array value.voidupdateCharacterStream(int columnIndex, Reader x)Updates the value at the 1-basedcolumnIndex.voidupdateCharacterStream(int columnIndex, Reader x, int length)Updates a column specified by a column index with a character stream value.voidupdateCharacterStream(int columnIndex, Reader x, long length)Updates the value at the 1-basedcolumnIndex.voidupdateCharacterStream(String columnLabel, Reader reader)Updates the value in the named column.voidupdateCharacterStream(String columnName, Reader reader, int length)Updates a column specified by a column name with a character stream value.voidupdateCharacterStream(String columnLabel, Reader reader, long length)Updates the value in the named column.voidupdateClob(int columnIndex, Reader reader)Updates the value at the 1-basedcolumnIndex.voidupdateClob(int columnIndex, Reader reader, long length)Updates the value at the 1-basedcolumnIndex.voidupdateClob(int columnIndex, Clob x)Updates a column specified by a column index with ajava.sql.Clobvalue.voidupdateClob(String columnLabel, Reader reader)Updates the value in the named column.voidupdateClob(String columnLabel, Reader reader, long length)Updates the value in the named column.voidupdateClob(String columnName, Clob x)Updates a column specified by a column name with ajava.sql.Clobvalue.voidupdateDate(int columnIndex, Date x)Updates a column specified by a column index with ajava.sql.Datevalue.voidupdateDate(String columnName, Date x)Updates a column specified by a column name with ajava.sql.Datevalue.voidupdateDouble(int columnIndex, double x)Updates a column specified by a column index with adoublevalue.voidupdateDouble(String columnName, double x)Updates a column specified by a column name with adoublevalue.voidupdateFloat(int columnIndex, float x)Updates a column specified by a column index with afloatvalue.voidupdateFloat(String columnName, float x)Updates a column specified by a column name with afloatvalue.voidupdateInt(int columnIndex, int x)Updates a column specified by a column index with anintvalue.voidupdateInt(String columnName, int x)Updates a column specified by a column name with anintvalue.voidupdateLong(int columnIndex, long x)Updates a column specified by a column index with alongvalue.voidupdateLong(String columnName, long x)Updates a column specified by a column name with alongvalue.voidupdateNCharacterStream(int columnIndex, Reader x)Updates the value at the 1-basedcolumnIndex.voidupdateNCharacterStream(int columnIndex, Reader x, long length)Updates the value at the 1-basedcolumnIndex.voidupdateNCharacterStream(String columnLabel, Reader reader)Updates the value in the named column.voidupdateNCharacterStream(String columnLabel, Reader reader, long length)Updates the value in the named column.voidupdateNClob(int columnIndex, Reader reader)Updates the value at the 1-basedcolumnIndex.voidupdateNClob(int columnIndex, Reader reader, long length)Updates the value at the 1-basedcolumnIndex.voidupdateNClob(int columnIndex, NClob nClob)Updates the value at the 1-basedcolumnIndex.voidupdateNClob(String columnLabel, Reader reader)Updates the value in the named column.voidupdateNClob(String columnLabel, Reader reader, long length)Updates the value in the named column.voidupdateNClob(String columnLabel, NClob nClob)Updates the value in the named column.voidupdateNString(int columnIndex, String nString)Updates the value at the 1-basedcolumnIndex.voidupdateNString(String columnLabel, String nString)Updates the value in the named column.voidupdateNull(int columnIndex)Updates a column specified by a column index with anullvalue.voidupdateNull(String columnName)Updates a column specified by a column name with anullvalue.voidupdateObject(int columnIndex, Object x)Updates a column specified by a column index with anObjectvalue.voidupdateObject(int columnIndex, Object x, int scale)Updates a column specified by a column index with anObjectvalue.voidupdateObject(String columnName, Object x)Updates a column specified by a column name with anObjectvalue.voidupdateObject(String columnName, Object x, int scale)Updates a column specified by a column name with anObjectvalue.voidupdateRef(int columnIndex, Ref x)Updates a column specified by a column index with ajava.sql.Refvalue.voidupdateRef(String columnName, Ref x)Updates a column specified by a column name with ajava.sql.Refvalue.voidupdateRow()Updates the database with the new contents of the current row of thisResultSetobject.voidupdateRowId(int columnIndex, RowId value)Updates the value at the 1-basedcolumnIndex.voidupdateRowId(String columnLabel, RowId value)Updates the value in the named column.voidupdateShort(int columnIndex, short x)Updates a column specified by a column index with ashortvalue.voidupdateShort(String columnName, short x)Updates a column specified by a column name with ashortvalue.voidupdateSQLXML(int columnIndex, SQLXML xmlObject)Updates the value at the 1-basedcolumnIndex.voidupdateSQLXML(String columnLabel, SQLXML xmlObject)Updates the value in the named column.voidupdateString(int columnIndex, String x)Updates a column specified by a column index with aStringvalue.voidupdateString(String columnName, String x)Updates a column specified by a column name with aStringvalue.voidupdateTime(int columnIndex, Time x)Updates a column specified by a column index with aTimevalue.voidupdateTime(String columnName, Time x)Updates a column specified by a column name with aTimevalue.voidupdateTimestamp(int columnIndex, Timestamp x)Updates a column specified by a column index with aTimestampvalue.voidupdateTimestamp(String columnName, Timestamp x)Updates a column specified by column name with aTimestampvalue.booleanwasNull()Determines whether the last column read from thisResultSetcontained SQLNULL.Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Field Details
-
CLOSE_CURSORS_AT_COMMIT
static final int CLOSE_CURSORS_AT_COMMITA constant used to indicate that aResultSetobject must be closed when the methodConnection.commitis invoked.- See Also:
- Constant Field Values
-
HOLD_CURSORS_OVER_COMMIT
static final int HOLD_CURSORS_OVER_COMMITA constant used to indicate that aResultSetobject must not be closed when the methodConnection.commitis invoked.- See Also:
- Constant Field Values
-
CONCUR_READ_ONLY
static final int CONCUR_READ_ONLYA constant used to indicate the concurrency mode for aResultSetobject that cannot be updated.- See Also:
- Constant Field Values
-
CONCUR_UPDATABLE
static final int CONCUR_UPDATABLEA constant used to indicate the concurrency mode for aResultSetobject that can be updated.- See Also:
- Constant Field Values
-
FETCH_FORWARD
static final int FETCH_FORWARDA constant used to indicate processing of the rows of aResultSetin the forward direction, first to last.- See Also:
- Constant Field Values
-
FETCH_REVERSE
static final int FETCH_REVERSEA constant used to indicate processing of the rows of aResultSetin the reverse direction, last to first.- See Also:
- Constant Field Values
-
FETCH_UNKNOWN
static final int FETCH_UNKNOWNA constant used to indicate that the order of processing of the rows of aResultSetis unknown.- See Also:
- Constant Field Values
-
TYPE_FORWARD_ONLY
static final int TYPE_FORWARD_ONLYA constant used to indicate aResultSetobject whose cursor can only move forward.- See Also:
- Constant Field Values
-
TYPE_SCROLL_INSENSITIVE
static final int TYPE_SCROLL_INSENSITIVEA constant used to indicate aResultSetobject which is scrollable but is insensitive to changes made by others.- See Also:
- Constant Field Values
-
TYPE_SCROLL_SENSITIVE
static final int TYPE_SCROLL_SENSITIVEA constant used to indicate aResultSetobject which is scrollable and sensitive to changes made by others.- See Also:
- Constant Field Values
-
-
Method Details
-
absolute
Moves the cursor to a specified row number in theResultSet.- Parameters:
row- the index of the row starting at index 1. Index-1returns the last row.- Returns:
trueif the new cursor position is on theResultSet,falseotherwise.- Throws:
SQLException- if a database error happens.
-
afterLast
Moves the cursor to the end of theResultSet, after the last row.- Throws:
SQLException- if a database error happens.
-
beforeFirst
Moves the cursor to the start of theResultSet, before the first row.- Throws:
SQLException- if a database error happens.
-
cancelRowUpdates
Cancels any updates made to the current row in theResultSet.- Throws:
SQLException- if a database error happens.
-
clearWarnings
Clears all warnings related to thisResultSet.- Throws:
SQLException- if a database error happens.
-
close
Releases thisResultSet's database and JDBC resources. You are strongly advised to use this method rather than relying on the release being done when theResultSet's finalize method is called during garbage collection process. Note that theclose()method might take some time to complete since it is dependent on the behavior of the connection to the database and the database itself.- Specified by:
closein interfaceAutoCloseable- Throws:
SQLException- if a database error happens.
-
deleteRow
Deletes the current row from theResultSetand from the underlying database.- Throws:
SQLException- if a database error happens.
-
findColumn
Gets the index number for a column in theResultSetfrom the provided column name.- Parameters:
columnName- the column name.- Returns:
- the column's index in the
ResultSetidentified by column name. - Throws:
SQLException- if a database error happens.
-
first
Shifts the cursor position to the first row in theResultSet.- Returns:
trueif the position is in a legitimate row,falseif theResultSetcontains no rows.- Throws:
SQLException- if a database error happens.
-
getArray
Gets the content of a column specified by column index in the current row of thisResultSetas ajava.sql.Array.- Parameters:
columnIndex- the index of the column to read- Returns:
- a
java.sql.Arraywith the data from the column. - Throws:
SQLException- if a database error happens.
-
getArray
Gets the value of a column specified by column name as ajava.sql.Array.- Parameters:
colName- the name of the column to read.- Returns:
- a
java.sql.Arraywith the data from the specified column. - Throws:
SQLException- if a database error happens.
-
getAsciiStream
Gets the value of a column specified by column index as an ASCII character stream.- Parameters:
columnIndex- the index of the column to read.- Returns:
- an
InputStreamwith the data from the column. - Throws:
SQLException- if a database error happens.
-
getAsciiStream
Gets the value of a column specified by column name as an ASCII character stream.- Parameters:
columnName- the name of the column to read- Returns:
- an
InputStreamwith the data from the column. - Throws:
SQLException- if a database error happens.
-
getBigDecimal
Gets the value of a column specified by column index as ajava.math.BigDecimal.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a
BigDecimalwith the value of the column. - Throws:
SQLException- if a database error happens.
-
getBigDecimal
Deprecated.UsegetBigDecimal(int)orgetBigDecimal(String)instead.Gets the value of a column specified by column index as ajava.math.BigDecimal.- Parameters:
columnIndex- the index of the column to read.scale- the number of digits after the decimal point- Returns:
- a
BigDecimalwith the value of the column. - Throws:
SQLException- if a database error happens.
-
getBigDecimal
Gets the value of a column specified by column name, as ajava.math.BigDecimal.- Parameters:
columnName- the name of the column to read.- Returns:
- a BigDecimal with value of the column.
- Throws:
SQLException- if a database error happens.
-
getBigDecimal
Deprecated.UsegetBigDecimal(int)orgetBigDecimal(String)instead.Gets the value of a column specified by column name, as ajava.math.BigDecimal.- Parameters:
columnName- the name of the column to read.scale- the number of digits after the decimal point- Returns:
- a BigDecimal with value of the column.
- Throws:
SQLException- if a database error happens.
-
getBinaryStream
Gets the value of a column specified by column index as a binary stream.This method can be used to read
LONGVARBINARYvalues. All of the data in theInputStreamshould be read before getting data from any other column. A further call to a getter method will implicitly close theInputStream.- Parameters:
columnIndex- the index of the column to read.- Returns:
- an
InputStreamwith the data from the column. If the column value is SQLNULL,nullis returned. - Throws:
SQLException- if a database error happens.
-
getBinaryStream
Gets the value of a column specified by column name as a binary stream.This method can be used to read
LONGVARBINARYvalues. All of the data in theInputStreamshould be read before getting data from any other column. A further call to a getter method will implicitly close theInputStream.- Parameters:
columnName- the name of the column to read.- Returns:
- an
InputStreamwith the data from the column if the column value is SQLNULL,nullis returned. - Throws:
SQLException- if a database error happens.
-
getBlob
Gets the value of a column specified by column index as ajava.sql.Blobobject.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a
java.sql.Blobwith the value of the column. - Throws:
SQLException- if a database error happens.
-
getBlob
Gets the value of a column specified by column name, as ajava.sql.Blobobject.- Parameters:
columnName- the name of the column to read.- Returns:
- a
java.sql.Blobwith the value of the column. - Throws:
SQLException- if a database error happens.
-
getBoolean
Gets the value of a column specified by column index as aboolean.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a
booleanvalue from the column. If the column is SQLNULL,falseis returned. - Throws:
SQLException- if a database error happens.
-
getBoolean
Gets the value of a column specified by column name, as aboolean.- Parameters:
columnName- the name of the column to read.- Returns:
- a
booleanvalue from the column. If the column is SQLNULL,falseis returned. - Throws:
SQLException- if a database error happens.
-
getByte
Gets the value of a column specified by column index as abyte.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a
byteequal to the value of the column. 0 if the value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getByte
Gets the value of a column specified by column name as abyte.- Parameters:
columnName- the name of the column to read.- Returns:
- a
byteequal to the value of the column. 0 if the value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getBytes
Gets the value of a column specified by column index as a byte array.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a byte array containing the value of the column.
nullif the column contains SQLNULL. - Throws:
SQLException- if a database error happens.
-
getBytes
Gets the value of a column specified by column name as a byte array.- Parameters:
columnName- the name of the column to read.- Returns:
- a byte array containing the value of the column.
nullif the column contains SQLNULL. - Throws:
SQLException- if a database error happens.
-
getCharacterStream
Gets the value of a column specified by column index as ajava.io.Readerobject.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a
Readerholding the value of the column.nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.- See Also:
Reader
-
getCharacterStream
Gets the value of a column specified by column name as ajava.io.Readerobject.- Parameters:
columnName- the name of the column to read.- Returns:
- a
Readerholding the value of the column.nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getClob
Gets the value of a column specified by column index as ajava.sql.Clob.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a
Clobobject representing the value in the column.nullif the value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getClob
Gets the value of a column specified by column name as ajava.sql.Clob.- Parameters:
colName- the name of the column to read.- Returns:
- a
Clobobject representing the value in the column.nullif the value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getConcurrency
Gets the concurrency mode of thisResultSet.- Returns:
- the concurrency mode - one of:
ResultSet.CONCUR_READ_ONLY,ResultSet.CONCUR_UPDATABLE. - Throws:
SQLException- if a database error happens.
-
getCursorName
Gets the name of the SQL cursor of thisResultSet.- Returns:
- the SQL cursor name.
- Throws:
SQLException- if a database error happens.
-
getDate
Gets the value of a column specified by column index as ajava.sql.Date.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a
java.sql.Datematching the column value.nullif the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getDate
Gets the value of a column specified by column index as ajava.sql.Date. This method uses a supplied calendar to compute the Date.- Parameters:
columnIndex- the index of the column to read.cal- ajava.util.Calendarto use in constructing the Date.- Returns:
- a
java.sql.Datematching the column value.nullif the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getDate
Gets the value of a column specified by column name as ajava.sql.Date.- Parameters:
columnName- the name of the column to read.- Returns:
- a
java.sql.Datematching the column value.nullif the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getDate
Gets the value of a column specified by column name, as ajava.sql.Dateobject.- Parameters:
columnName- the name of the column to read.cal-java.util.Calendarto use in constructing the Date.- Returns:
- a
java.sql.Datematching the column value.nullif the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getDouble
Gets the value of a column specified by column index as adoublevalue.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a
doubleequal to the column value.0.0if the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getDouble
Gets the value of a column specified by column name as adoublevalue.- Parameters:
columnName- the name of the column to read.- Returns:
- a
doubleequal to the column value.0.0if the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getFetchDirection
Gets the direction in which rows are fetched for thisResultSetobject.- Returns:
- the fetch direction. Will be one of:
- ResultSet.FETCH_FORWARD
- ResultSet.FETCH_REVERSE
- ResultSet.FETCH_UNKNOWN
- Throws:
SQLException- if a database error happens.
-
getFetchSize
Gets the fetch size (in number of rows) for thisResultSet.- Returns:
- the fetch size as an int
- Throws:
SQLException- if a database error happens.
-
getFloat
Gets the value of a column specified by column index as afloatvalue.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a
floatequal to the column value.0.0if the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getFloat
Gets the value of a column specified by column name as afloatvalue.- Parameters:
columnName- the name of the column to read.- Returns:
- a
floatequal to the column value.0.0if the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getInt
Gets the value of a column specified by column index as anintvalue.- Parameters:
columnIndex- the index of the column to read.- Returns:
- an
intequal to the column value.0if the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getInt
Gets the value of a column specified by column name, as anintvalue.- Parameters:
columnName- the name of the column to read.- Returns:
- an
intequal to the column value.0if the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getLong
Gets the value of a column specified by column index as alongvalue.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a
longequal to the column value.0if the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getLong
Gets the value of a column specified by column name, as alongvalue.- Parameters:
columnName- the name of the column to read.- Returns:
- a
longequal to the column value.0if the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getMetaData
Gets the metadata for thisResultSet. This defines the number, types and properties of the columns in theResultSet.- Returns:
- a
ResultSetMetaDataobject with information about thisResultSet. - Throws:
SQLException- if a database error happens.
-
getObject
Gets the value of a specified column as a JavaObject. The type of the returned object will be the default according to the column's SQL type, following the JDBC specification for built-in types.For SQL User Defined Types, if a column value is Structured or Distinct, this method behaves the same as a call to:
getObject(columnIndex,this.getStatement().getConnection().getTypeMap())- Parameters:
columnIndex- the index of the column to read.- Returns:
- an
Objectcontaining the value of the column.nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getObject
Gets the value of a column specified by column index as a JavaObject.The type of the Java object will be determined by the supplied Map to perform the mapping of SQL
Structor Distinct types into Java objects.- Parameters:
columnIndex- the index of the column to read.map- ajava.util.Mapcontaining a mapping from SQL Type names to Java classes.- Returns:
- an
Objectcontaining the value of the column.nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getObject
Gets the value of a specified column as a JavaObject. The type of the returned object will be the default according to the column's SQL type, following the JDBC specification for built-in types.For SQL User Defined Types, if a column value is structured or distinct, this method behaves the same as a call to:
getObject(columnIndex,this.getStatement().getConnection().getTypeMap())- Parameters:
columnName- the name of the column to read.- Returns:
- an
Objectcontaining the value of the column.nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getObject
Gets the value of a column specified by column name as a JavaObject.The type of the Java object will be determined by the supplied Map to perform the mapping of SQL Struct or Distinct types into Java objects.
- Parameters:
columnName- the name of the column to read.map- ajava.util.Mapcontaining a mapping from SQL Type names to Java classes.- Returns:
- an
Objectcontaining the value of the column.nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getRef
Gets the value of a column specified by column index as a Javajava.sql.Ref.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a Ref representing the value of the SQL REF in the column
- Throws:
SQLException- if a database error happens.
-
getRef
Gets the value of a column specified by column name as a Javajava.sql.Ref.- Parameters:
colName- the name of the column to read.- Returns:
- a Ref representing the value of the SQL
REFin the column - Throws:
SQLException- if a database error happens.
-
getRow
Gets the number of the current row in theResultSet. Row numbers start at 1 for the first row.- Returns:
- the index number of the current row.
0is returned if there is no current row. - Throws:
SQLException- if a database error happens.
-
getShort
Gets the value of a column specified by column index as a short value.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a short value equal to the value of the column.
0if the value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getShort
Gets the value of a column specified by column name, as a short value.- Parameters:
columnName- the name of the column to read.- Returns:
- a short value equal to the value of the column.
0if the value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getStatement
Gets the statement that produced thisResultSet. If theResultSetwas not created by a statement (i.e. because it was returned from one of theDatabaseMetaDatamethods),nullis returned.- Returns:
- the Statement which produced this
ResultSet, ornullif theResultSetwas not created by a Statement. - Throws:
SQLException- if a database error happens.
-
getString
Gets the value of a column specified by column index as a String.- Parameters:
columnIndex- the index of the column to read.- Returns:
- the String representing the value of the column,
nullif the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getString
Gets the value of a column specified by column name, as a String.- Parameters:
columnName- the name of the column to read.- Returns:
- the String representing the value of the column,
nullif the column is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getTime
Gets the value of a column specified by column index as ajava.sql.Timevalue.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a Time representing the column value,
nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getTime
Gets the value of a column specified by column index as ajava.sql.Timevalue. The suppliedCalendaris used to map the SQLTimevalue to a Java Time value.- Parameters:
columnIndex- the index of the column to read.cal- aCalendarto use in creating the Java Time value.- Returns:
- a Time representing the column value,
nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getTime
Gets the value of a column specified by column name, as ajava.sql.Timevalue.- Parameters:
columnName- the name of the column to read.- Returns:
- the column value,
nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getTime
Gets the value of a column specified by column index, as ajava.sql.Timevalue. The suppliedCalendaris used to map the SQLTimevalue to a Java Time value.- Parameters:
columnName- the name of the column to read.cal- aCalendarto use in creating the Java time value.- Returns:
- a Time representing the column value,
nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getTimestamp
Gets the value of a column specified by column index as ajava.sql.Timestampvalue.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a timestamp representing the column value,
nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getTimestamp
Gets the value of a column specified by column index, as ajava.sql.Timestampvalue. The supplied Calendar is used when mapping the SQLTimestampvalue to a JavaTimestampvalue.- Parameters:
columnIndex- the index of the column to read.cal- Calendar to use in creating the Java timestamp value.- Returns:
- a timestamp representing the column value,
nullif the column value is SQL NULL. - Throws:
SQLException- if a database error happens.
-
getTimestamp
Gets the value of a column specified by column name, as ajava.sql.Timestampvalue.- Parameters:
columnName- the name of the column to read.- Returns:
- a timestamp representing the column value,
nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getTimestamp
Gets the value of a column specified by column name, as ajava.sql.Timestampvalue. The supplied Calendar is used when mapping the SQLTimestampvalue to a JavaTimestampvalue.- Parameters:
columnName- the name of the column to read.cal- Calendar to use in creating the JavaTimestampvalue.- Returns:
- a timestamp representing the column value,
nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getType
Gets the type of theResultSet.- Returns:
- The
ResultSettype, one of:ResultSet.TYPE_FORWARD_ONLYResultSet.TYPE_SCROLL_INSENSITIVEResultSet.TYPE_SCROLL_SENSITIVE
- Throws:
SQLException- if there is a database error.
-
getUnicodeStream
Deprecated.UsegetCharacterStream(int)instead.Gets the value of the column as anInputStreamof unicode characters.- Parameters:
columnIndex- the index of the column to read.- Returns:
- an
InputStreamholding the value of the column.nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getUnicodeStream
Deprecated.UsegetCharacterStream(int)instead.Gets the value of the column as anInputStreamof Unicode characters.- Parameters:
columnName- the name of the column to read.- Returns:
- an
InputStreamholding the value of the column.nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getURL
Gets the value of a column specified by column index as ajava.net.URL.- Parameters:
columnIndex- the index of the column to read.- Returns:
- a URL.
nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getURL
Gets the value of a column specified by column name as ajava.net.URLobject.- Parameters:
columnName- the name of the column to read.- Returns:
- the column vaule as a URL.
nullif the column value is SQLNULL. - Throws:
SQLException- if a database error happens.
-
getWarnings
Gets the first warning generated by calls on thisResultSet. Subsequent warnings on thisResultSetare chained to the first one.The warnings are cleared when a new Row is read from the
ResultSet. The warnings returned by this method are only the warnings generated byResultSetmethod calls - warnings generated by Statement methods are held by the Statement.An
SQLExceptionis generated if this method is called on a closedResultSet.- Returns:
- an SQLWarning which is the first warning for this
ResultSet.nullif there are no warnings. - Throws:
SQLException- if a database error happens.
-
insertRow
Insert the insert row into theResultSetand into the underlying database. The cursor must be set to the Insert Row before this method is invoked.- Throws:
SQLException- if a database error happens. Particular cases include the cursor not being on the Insert Row or if any columns in the row do not have a value where the column is declared as not-nullable.
-
isAfterLast
Gets if the cursor is after the last row of theResultSet.- Returns:
trueif the cursor is after the last row in theResultSet,falseif the cursor is at any other position in theResultSet.- Throws:
SQLException- if a database error happens.
-
isBeforeFirst
Gets if the cursor is before the first row of theResultSet.- Returns:
trueif the cursor is before the first row in theResultSet,falseif the cursor is at any other position in theResultSet.- Throws:
SQLException- if a database error happens.
-
isFirst
Gets if the cursor is on the first row of theResultSet.- Returns:
trueif the cursor is on the first row in theResultSet,falseif the cursor is at any other position in theResultSet.- Throws:
SQLException- if a database error happens.
-
isLast
Gets if the cursor is on the last row of theResultSet- Returns:
trueif the cursor is on the last row in theResultSet,falseif the cursor is at any other position in theResultSet.- Throws:
SQLException- if a database error happens.
-
last
Shifts the cursor position to the last row of theResultSet.- Returns:
trueif the new position is in a legitimate row,falseif theResultSetcontains no rows.- Throws:
SQLException- if there is a database error.
-
moveToCurrentRow
Moves the cursor to the remembered position, namely the row that was the current row before a call tomoveToInsertRow. This only applies if the cursor is on the Insert Row.- Throws:
SQLException- if a database error happens.
-
moveToInsertRow
Moves the cursor position to the Insert Row. The current position is remembered and the cursor is positioned at the Insert Row. The columns in the Insert Row should be filled in with the appropriate update methods, before callinginsertRowto insert the new row into the database.- Throws:
SQLException- if a database error happens.
-
next
Shifts the cursor position down one row in thisResultSetobject.Any input streams associated with the current row are closed and any warnings are cleared.
- Returns:
trueif the updated cursor position is pointing to a valid row,falseotherwise (i.e. when the cursor is after the last row in theResultSet).- Throws:
SQLException- if a database error happens.
-
previous
Relocates the cursor position to the preceding row in thisResultSet.- Returns:
trueif the new position is in a legitimate row,falseif the cursor is now before the first row.- Throws:
SQLException- if a database error happens.
-
refreshRow
Refreshes the current row with its most up to date value in the database. Must not be called when the cursor is on the Insert Row.If any columns in the current row have been updated but the
updateRowhas not been called, then the updates are lost when this method is called.- Throws:
SQLException- if a database error happens., including if the current row is the Insert row.
-
relative
Moves the cursor position up or down by a specified number of rows. If the new position is beyond the start row (or end row), the cursor position is set before the first row (or, respectively, after the last row).- Parameters:
rows- a number of rows to move the cursor - may be positive or negative- Returns:
trueif the new cursor position is on a row,falseotherwise- Throws:
SQLException- if a database error happens.
-
rowDeleted
Indicates whether a row has been deleted. This method depends on whether the JDBC driver and database can detect deletions.- Returns:
trueif a row has been deleted and if deletions are detected,falseotherwise.- Throws:
SQLException- if a database error happens.
-
rowInserted
Indicates whether the current row has had an insertion operation. This method depends on whether the JDBC driver and database can detect insertions.- Returns:
trueif a row has been inserted and if insertions are detected,falseotherwise.- Throws:
SQLException- if a database error happens.
-
rowUpdated
Indicates whether the current row has been updated. This method depends on whether the JDBC driver and database can detect updates.- Returns:
trueif the current row has been updated and if updates can be detected,falseotherwise.- Throws:
SQLException- if a database error happens.
-
setFetchDirection
Indicates which direction (forward/reverse) will be used to process the rows of thisResultSetobject. This is treated as a hint by the JDBC driver.- Parameters:
direction- can beResultSet.FETCH_FORWARD,ResultSet.FETCH_REVERSE, orResultSet.FETCH_UNKNOWN- Throws:
SQLException- if there is a database error.
-
setFetchSize
Indicates the number of rows to fetch from the database when extra rows are required for thisResultSet. This used as a hint to the JDBC driver.- Parameters:
rows- the number of rows to fetch.0implies that the JDBC driver can make its own decision about the fetch size. The number should not be greater than the maximum number of rows established by the statement that generated theResultSet.- Throws:
SQLException- if a database error happens.
-
updateArray
Updates a column specified by a column index with ajava.sql.Arrayvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateArray
Updates a column specified by a column name with ajava.sql.Arrayvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateAsciiStream
Updates a column specified by a column index with an ASCII stream value.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.length- the length of the data to write from the stream- Throws:
SQLException- if a database error happens.
-
updateAsciiStream
Updates a column specified by a column name with an Ascii stream value.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.length- the length of the data to write from the stream- Throws:
SQLException- if a database error happens.
-
updateBigDecimal
Updates a column specified by a column index with ajava.sql.BigDecimalvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateBigDecimal
Updates a column specified by a column name with ajava.sql.BigDecimalvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateBinaryStream
Updates a column specified by a column index with a binary stream value.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.length- the number of bytes to be read from the the stream.- Throws:
SQLException- if a database error happens.
-
updateBinaryStream
Updates a column specified by a column name with a binary stream value.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.length- he number of bytes to be read from the the stream.- Throws:
SQLException- if a database error happens.
-
updateBlob
Updates a column specified by a column index with ajava.sql.Blobvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateBlob
Updates a column specified by a column name with ajava.sql.Blobvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateBoolean
Updates a column specified by a column index with abooleanvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateBoolean
Updates a column specified by a column name with abooleanvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateByte
Updates a column specified by a column index with abytevalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateByte
Updates a column specified by a column name with abytevalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateBytes
Updates a column specified by a column index with abytearray value.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateBytes
Updates a column specified by a column name with a byte array value.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateCharacterStream
Updates a column specified by a column index with a character stream value.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.length- the length of data to write from the stream- Throws:
SQLException- if a database error happens.
-
updateCharacterStream
Updates a column specified by a column name with a character stream value.- Parameters:
columnName- the name of the column to update.reader- the new value for the specified column.length- the length of data to write from the Reader- Throws:
SQLException- if a database error happens.
-
updateClob
Updates a column specified by a column index with ajava.sql.Clobvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateClob
Updates a column specified by a column name with ajava.sql.Clobvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateDate
Updates a column specified by a column index with ajava.sql.Datevalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateDate
Updates a column specified by a column name with ajava.sql.Datevalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateDouble
Updates a column specified by a column index with adoublevalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateDouble
Updates a column specified by a column name with adoublevalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateFloat
Updates a column specified by a column index with afloatvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateFloat
Updates a column specified by a column name with afloatvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateInt
Updates a column specified by a column index with anintvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateInt
Updates a column specified by a column name with anintvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateLong
Updates a column specified by a column index with alongvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column..- Throws:
SQLException- if a database error happens.
-
updateLong
Updates a column specified by a column name with alongvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateNull
Updates a column specified by a column index with anullvalue.- Parameters:
columnIndex- the index of the column to update.- Throws:
SQLException- if a database error happens.
-
updateNull
Updates a column specified by a column name with anullvalue.- Parameters:
columnName- the name of the column to update.- Throws:
SQLException- if a database error happens.
-
updateObject
Updates a column specified by a column index with anObjectvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateObject
Updates a column specified by a column index with anObjectvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.scale- for the typesjava.sql.Types.DECIMALorjava.sql.Types.NUMERIC, this specifies the number of digits after the decimal point.- Throws:
SQLException- if a database error happens.
-
updateObject
Updates a column specified by a column name with anObjectvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateObject
Updates a column specified by a column name with anObjectvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.scale- for the typesjava.sql.Types.DECIMALorjava.sql.Types.NUMERIC, this specifies the number of digits after the decimal point.- Throws:
SQLException- if a database error happens.
-
updateRef
Updates a column specified by a column index with ajava.sql.Refvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateRef
Updates a column specified by a column name with ajava.sql.Refvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateRow
Updates the database with the new contents of the current row of thisResultSetobject.- Throws:
SQLException- if a database error happens.
-
updateShort
Updates a column specified by a column index with ashortvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateShort
Updates a column specified by a column name with ashortvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateString
Updates a column specified by a column index with aStringvalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateString
Updates a column specified by a column name with aStringvalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateTime
Updates a column specified by a column index with aTimevalue.- Parameters:
columnIndex- the index of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateTime
Updates a column specified by a column name with aTimevalue.- Parameters:
columnName- the name of the column to update.x- the new value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateTimestamp
Updates a column specified by a column index with aTimestampvalue.- Parameters:
columnIndex- the index of the column to update.x- the new timestamp value for the specified column.- Throws:
SQLException- if a database error happens.
-
updateTimestamp
Updates a column specified by column name with aTimestampvalue.- Parameters:
columnName- the name of the column to update.x- the new timestamp value for the specified column.- Throws:
SQLException- if a database error happens.
-
wasNull
Determines whether the last column read from thisResultSetcontained SQLNULL.- Returns:
- {@code {@code true} if the last column contained SQL {@code NULL}, {@code false} otherwise @throws SQLException if a database error happens.
- Throws:
SQLException
-
getRowId
Returns aRowIdcorresponding to the SQL ROWID at the 1-basedcolumnIndex.- Throws:
SQLException
-
getRowId
Returns aRowIdcorresponding to the SQL ROWID at the named column.- Throws:
SQLException
-
updateRowId
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateRowId
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
getHoldability
Returns the holdability of this result set:HOLD_CURSORS_OVER_COMMITorCLOSE_CURSORS_AT_COMMIT.- Throws:
SQLException
-
isClosed
Returns true if this result set has been closed, false otherwise.- Throws:
SQLException
-
updateNString
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateNString
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateNClob
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateNClob
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
getNClob
Returns anNClobcorresponding to the value at the 1-basedcolumnIndex.- Throws:
SQLException
-
getNClob
Returns anNClobcorresponding to the value in the named column.- Throws:
SQLException
-
getSQLXML
Returns anSQLXMLcorresponding to the value at the 1-basedcolumnIndex.- Throws:
SQLException
-
getSQLXML
Returns anSQLXMLcorresponding to the value in the named column.- Throws:
SQLException
-
updateSQLXML
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateSQLXML
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
getNString
Returns aStringcorresponding to the value at the 1-basedcolumnIndex.- Throws:
SQLException
-
getNString
Returns aStringcorresponding to the value in the named column.- Throws:
SQLException
-
getNCharacterStream
Returns aReadercorresponding to the value at the 1-basedcolumnIndex.- Throws:
SQLException
-
getNCharacterStream
Returns aReadercorresponding to the value in the named column.- Throws:
SQLException
-
updateNCharacterStream
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateNCharacterStream
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateAsciiStream
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateBinaryStream
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateCharacterStream
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateAsciiStream
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateBinaryStream
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateCharacterStream
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateBlob
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateBlob
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateClob
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateClob
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateNClob
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateNClob
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateNCharacterStream
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateNCharacterStream
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateAsciiStream
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateBinaryStream
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateCharacterStream
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateAsciiStream
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateBinaryStream
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateCharacterStream
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateBlob
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateBlob
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateClob
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateClob
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateNClob
Updates the value at the 1-basedcolumnIndex. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
updateNClob
Updates the value in the named column. The underlying database isn't changed until the next row update or insert operation.- Throws:
SQLException
-
getBigDecimal(int)orgetBigDecimal(String)instead.