public class AS400JDBCResultSet extends Object implements ResultSet
The AS400JDBCResultSet class provides access to a table of data generated by a database query.
A result set maintains a cursor pointing to its current row of data. Initially, the cursor is positioned before the first row. If the result set is scrollable, use any of the cursor positioning methods to move the cursor within the result set. If the result set is not scrollable, then only use next() to move the cursor.
The get methods retrieve column values for the current row. Values can be retrieved using either the column index or the column name. In general, using the column index is more efficient. Column indexes are numbered starting with 1. Column names are not case sensitive. If several columns have the same name, then the first matching column is used.
Columns can have two names: a column name ("long name") and a system column name ("short name"). The get methods and findColumn() only support using the column name.
In each get method, the driver attempts to convert the underlying data to the specified Java type and returns a suitable Java value. If such a conversion is not appropriate, an SQLException is thrown.
If the result set is updatable, the update methods modify column values for the current row, but not in the underlying database. updateRow() causes all updates to the current row to be written to the database. Use deleteRow() to delete the current row in the database.
For updatable result sets, there is also an insert row, which is used as a staging area for the contents of a new row. Use moveToInsertRow() to position the cursor to the insert row. Once all updates to the insert row have been made, use insertRow() to insert the row into the database.
In the following cases, result sets are always read only regardless of the concurrency set in the statement:
In the following case, result sets are always read only regardless of the concurrency set in the statement if connecting to a system running OS/400 V4R5 or a previous release:
In the following case, result sets are always forward only regardless of the type set in the statement:
A result set is automatically closed by the statement that generated it when the statement is closed, run again, or used to retrieve the next result set from a sequence of multiple result sets.
The new JDBC 3.0 methods add the ability to retrieve information by column name in addition to column index. Be aware you will see better performance accessing columns by their index rather than accessing them by their name.
CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
Modifier and Type | Method and Description |
---|---|
boolean |
absolute(int rowNumber)
Positions the cursor to an absolute row number.
|
protected void |
addSavedException(SQLException savedException) |
void |
afterLast()
Positions the cursor after the last row.
|
void |
beforeFirst()
Positions the cursor before the first row.
|
void |
cancelRowUpdates()
Cancels all pending updates that have been made since the last
call to updateRow().
|
void |
clearWarnings()
Clears all warnings that have been reported for the result set.
|
void |
close()
Releases the result set's resources immediately instead of
waiting for them to be automatically released.
|
void |
deleteRow()
Deletes the current row from the result set and the database.
|
protected void |
finalize()
Closes the result set if not explicitly closed by the caller.
|
int |
findColumn(String columnName)
Returns the column index for the specified column name.
|
boolean |
first()
Positions the cursor to the first row.
|
Array |
getArray(int columnIndex)
Returns the value of a column as an Array object.
|
Array |
getArray(String columnName)
Returns the value of a column as an Array object.
|
InputStream |
getAsciiStream(int columnIndex)
Returns the value of a column as a stream of ASCII
characters.
|
InputStream |
getAsciiStream(String columnName)
Returns the value of a column as a stream of ASCII
characters.
|
BigDecimal |
getBigDecimal(int columnIndex)
Returns the value of a column as a BigDecimal object.
|
BigDecimal |
getBigDecimal(int columnIndex,
int scale)
Deprecated.
Use getBigDecimal(int) instead.
|
BigDecimal |
getBigDecimal(String columnName)
Returns the value of a column as a BigDecimal object.
|
BigDecimal |
getBigDecimal(String columnName,
int scale)
Deprecated.
Use getBigDecimal(String) instead.
|
InputStream |
getBinaryStream(int columnIndex)
Returns the value of a column as a stream of uninterpreted
bytes.
|
InputStream |
getBinaryStream(String columnName)
Returns the value of a column as a stream of uninterpreted
bytes.
|
Blob |
getBlob(int columnIndex)
Returns the value of a column as a Blob object.
|
Blob |
getBlob(String columnName)
Returns the value of a column as a Blob object.
|
boolean |
getBoolean(int columnIndex)
Returns the value of a column as a Java boolean value.
|
boolean |
getBoolean(String columnName)
Returns the value of a column as a Java boolean value.
|
byte |
getByte(int columnIndex)
Returns the value of a column as a Java byte value.
|
byte |
getByte(String columnName)
Returns the value of a column as a Java byte value.
|
byte[] |
getBytes(int columnIndex)
Returns the value of a column as a Java byte array.
|
byte[] |
getBytes(String columnName)
Returns the value of a column as a Java byte array.
|
Reader |
getCharacterStream(int columnIndex)
Returns the value of a column as a character stream.
|
Reader |
getCharacterStream(String columnName)
Returns the value of a column as a character stream.
|
Clob |
getClob(int columnIndex)
Returns the value of a column as a Clob object.
|
Clob |
getClob(String columnName)
Returns the value of a column as a Clob object.
|
int |
getConcurrency()
Returns the result set concurrency.
|
String |
getCursorName()
Returns the name of the SQL cursor in use by the result set.
|
Date |
getDate(int columnIndex)
Returns the value of a column as a java.sql.Date object using
the default calendar.
|
Date |
getDate(int columnIndex,
Calendar calendar)
Returns the value of a column as a java.sql.Date object using
a calendar other than the default.
|
Date |
getDate(String columnName)
Returns the value of a column as a java.sql.Date object using
the default calendar.
|
Date |
getDate(String columnName,
Calendar calendar)
Returns the value of a column as a java.sql.Date object using
a calendar other than the default.
|
double |
getDouble(int columnIndex)
Returns the value of a column as a Java double value.
|
double |
getDouble(String columnName)
Returns the value of a column as a Java double value.
|
int |
getFetchDirection()
Returns the fetch direction.
|
int |
getFetchSize()
Returns the fetch size.
|
float |
getFloat(int columnIndex)
Returns the value of a column as a Java float value.
|
float |
getFloat(String columnName)
Returns the value of a column as a Java float value.
|
int |
getHoldability()
Retrieves the holdability of this
ResultSet object |
int |
getInt(int columnIndex)
Returns the value of a column as a Java int value.
|
int |
getInt(String columnName)
Returns the value of a column as a Java int value.
|
long |
getLong(int columnIndex)
Returns the value of a column as a Java long value.
|
long |
getLong(String columnName)
Returns the value of a column as a Java long value.
|
ResultSetMetaData |
getMetaData()
Returns the ResultSetMetaData object that describes the
result set's columns.
|
Reader |
getNCharacterStream(int columnIndex)
Retrieves the value of the designated column in the current row
of this
ResultSet object as a
java.io.Reader object. |
Reader |
getNCharacterStream(String columnName)
Retrieves the value of the designated column in the current row
of this
ResultSet object as a
java.io.Reader object. |
String |
getNString(int columnIndex)
Retrieves the value of the designated column in the current row
of this
ResultSet object as
a String in the Java programming language. |
String |
getNString(String columnName)
Retrieves the value of the designated column in the current row
of this
ResultSet object as
a String in the Java programming language. |
Object |
getObject(int columnIndex)
Returns the value of a column as a Java Object.
|
Object |
getObject(int columnIndex,
Class type) |
Object |
getObject(int columnIndex,
Map typeMap)
Returns the value of a column as a Java Object.
|
Object |
getObject(String columnName)
Returns the value of a column as a Java Object.
|
Object |
getObject(String columnLabel,
Class type)
Retrieves the value of the designated column in the current row of this ResultSet object and will convert from the
SQL type of the column to the requested Java data type, if the conversion is supported.
|
Object |
getObject(String columnName,
Map typeMap)
Returns the value of a column as a Java Object.
|
Ref |
getRef(int columnIndex)
Returns the value of a column as a Ref object.
|
Ref |
getRef(String columnName)
Returns the value of a column as a Ref object.
|
int |
getRow()
Returns the current row number, or 0.
|
short |
getShort(int columnIndex)
Returns the value of a column as a Java short value.
|
short |
getShort(String columnName)
Returns the value of a column as a Java short value.
|
Statement |
getStatement()
Returns the statement for this result set.
|
String |
getString(int columnIndex)
Returns the value of a column as a String object.
|
String |
getString(String columnName)
Returns the value of a column as a String object.
|
Time |
getTime(int columnIndex)
Returns the value of a column as a java.sql.Time object using the
default calendar.
|
Time |
getTime(int columnIndex,
Calendar calendar)
Returns the value of a column as a java.sql.Time object using a
calendar other than the default.
|
Time |
getTime(String columnName)
Returns the value of a column as a java.sql.Time object using the
default calendar.
|
Time |
getTime(String columnName,
Calendar calendar)
Returns the value of a column as a java.sql.Time object using a
calendar other than the default.
|
Timestamp |
getTimestamp(int columnIndex)
Returns the value of a column as a java.sql.Timestamp object
using the default calendar.
|
Timestamp |
getTimestamp(int columnIndex,
Calendar calendar)
Returns the value of a column as a java.sql.Timestamp object
using a calendar other than the default.
|
Timestamp |
getTimestamp(String columnName)
Returns the value of a column as a java.sql.Timestamp object
using the default calendar.
|
Timestamp |
getTimestamp(String columnName,
Calendar calendar)
Returns the value of a column as a java.sql.Timestamp object
using a calendar other than the default.
|
int |
getType()
Returns the result set type.
|
InputStream |
getUnicodeStream(int columnIndex)
Deprecated.
Use getCharacterStream(int) instead.
|
InputStream |
getUnicodeStream(String columnName)
Deprecated.
Use getCharacterStream(String) instead.
|
URL |
getURL(int columnIndex)
Returns the value of an SQL DATALINK output parameter as a
java.net.URL object.
|
URL |
getURL(String columnName)
Returns the value of an SQL DATALINK output parameter as a
java.net.URL object.
|
protected String[] |
getValidWrappedList() |
SQLWarning |
getWarnings()
Returns the first warning reported for the result set.
|
void |
insertRow()
Inserts the contents of the insert row into the result set
and the database.
|
boolean |
isAfterLast()
Indicates if the cursor is positioned after the last row.
|
boolean |
isBeforeFirst()
Indicates if the cursor is positioned before the first row.
|
boolean |
isClosed()
Indicates if the result set is closed.
|
boolean |
isFirst()
Indicates if the cursor is positioned on the first row.
|
boolean |
isLast()
Indicates if the cursor is positioned on the last row.
|
boolean |
last()
Positions the cursor to the last row.
|
void |
moveToCurrentRow()
Positions the cursor to the current row.
|
void |
moveToInsertRow()
Positions the cursor to the insert row.
|
boolean |
next()
Positions the cursor to the next row.
|
boolean |
previous()
Positions the cursor to the previous row.
|
void |
refreshRow()
Refreshes the current row from the database and cancels all
pending updates that have been made since the last call to
updateRow().
|
boolean |
relative(int rowNumber)
Positions the cursor to a relative row number.
|
boolean |
rowDeleted()
Indicates if the current row has been deleted.
|
boolean |
rowInserted()
Indicates if the current row has been inserted.
|
boolean |
rowUpdated()
Indicates if the current row has been updated.
|
void |
setFetchDirection(int fetchDirection)
Sets the direction in which the rows in a result set are
processed.
|
void |
setFetchSize(int fetchSize)
Sets the number of rows to be fetched from the database when more
rows are needed.
|
String |
toString()
Returns the name of the SQL cursor in use by the result set.
|
void |
updateArray(int columnIndex,
Array columnValue)
Updates the value of a column as an Array object.
|
void |
updateArray(String columnName,
Array columnValue)
Updates the value of a column as an Array object.
|
void |
updateAsciiStream(int columnIndex,
InputStream x)
Updates the designated column with an ascii stream value.
|
void |
updateAsciiStream(int columnIndex,
InputStream columnValue,
int length)
Updates a column in the current row using an ASCII stream value.
|
void |
updateAsciiStream(int columnIndex,
InputStream x,
long length)
Updates the designated column with an ascii stream value, which will have
the specified number of bytes.
|
void |
updateAsciiStream(String columnLabel,
InputStream x)
Updates the designated column with an ascii stream value.
|
void |
updateAsciiStream(String columnName,
InputStream columnValue,
int length)
Updates a column in the current row using an ASCII stream value.
|
void |
updateAsciiStream(String columnLabel,
InputStream x,
long length)
Updates the designated column with an ascii stream value, which will have
the specified number of bytes.
|
void |
updateBigDecimal(int columnIndex,
BigDecimal columnValue)
Updates a column in the current row using a BigDecimal value.
|
void |
updateBigDecimal(String columnName,
BigDecimal columnValue)
Updates a column in the current row using a BigDecimal value.
|
void |
updateBinaryStream(int columnIndex,
InputStream x)
Updates the designated column with a binary stream value.
|
void |
updateBinaryStream(int columnIndex,
InputStream columnValue,
int length)
Updates a column in the current row using a binary stream value.
|
void |
updateBinaryStream(int columnIndex,
InputStream x,
long length)
Updates the designated column with a binary stream value, which will have
the specified number of bytes.
|
void |
updateBinaryStream(String columnLabel,
InputStream x)
Updates the designated column with a binary stream value.
|
void |
updateBinaryStream(String columnName,
InputStream columnValue,
int length)
Updates a column in the current row using a binary stream value.
|
void |
updateBinaryStream(String columnLabel,
InputStream x,
long length)
Updates the designated column with a binary stream value, which will have
the specified number of bytes.
|
void |
updateBlob(int columnIndex,
Blob columnValue)
Updates a column in the current row using a Java Blob value.
|
void |
updateBlob(int columnIndex,
InputStream inputStream)
Updates the designated column using the given input stream.
|
void |
updateBlob(int columnIndex,
InputStream inputStream,
long length)
Updates the designated column using the given input stream, which
will have the specified number of bytes.
|
void |
updateBlob(String columnName,
Blob columnValue)
Updates a column in the current row using a Java Blob value.
|
void |
updateBlob(String columnLabel,
InputStream inputStream)
Updates the designated column using the given input stream.
|
void |
updateBlob(String columnLabel,
InputStream inputStream,
long length)
Updates the designated column using the given input stream, which
will have the specified number of bytes.
|
void |
updateBoolean(int columnIndex,
boolean columnValue)
Updates a column in the current row using a Java boolean value.
|
void |
updateBoolean(String columnName,
boolean columnValue)
Updates a column in the current row using a Java boolean value.
|
void |
updateByte(int columnIndex,
byte columnValue)
Updates a column in the current row using a Java byte value.
|
void |
updateByte(String columnName,
byte columnValue)
Updates a column in the current row using a Java byte value.
|
void |
updateBytes(int columnIndex,
byte[] columnValue)
Updates a column in the current row using a Java byte array value.
|
void |
updateBytes(String columnName,
byte[] columnValue)
Updates a column in the current row using a Java byte array value.
|
void |
updateCharacterStream(int columnIndex,
Reader x)
Updates the designated column with a character stream value.
|
void |
updateCharacterStream(int columnIndex,
Reader columnValue,
int length)
Updates a column in the current row using a Reader value.
|
void |
updateCharacterStream(int columnIndex,
Reader x,
long length)
Updates the designated column with a character stream value, which will have
the specified number of bytes.
|
void |
updateCharacterStream(String columnLabel,
Reader reader)
Updates the designated column with a character stream value.
|
void |
updateCharacterStream(String columnName,
Reader columnValue,
int length)
Updates a column in the current row using a Reader value.
|
void |
updateCharacterStream(String columnLabel,
Reader reader,
long length)
Updates the designated column with a character stream value, which will have
the specified number of bytes.
|
void |
updateClob(int columnIndex,
Clob columnValue)
Updates a column in the current row using a Java Clob value.
|
void |
updateClob(int columnIndex,
Reader reader)
Updates the designated column using the given
Reader
object. |
void |
updateClob(int columnIndex,
Reader reader,
long length)
Updates the designated column using the given
Reader
object, which is the given number of characters long. |
void |
updateClob(String columnName,
Clob columnValue)
Updates a column in the current row using a Java Clob value.
|
void |
updateClob(String columnLabel,
Reader reader)
Updates the designated column using the given
Reader
object. |
void |
updateClob(String columnLabel,
Reader reader,
long length)
Updates the designated column using the given
Reader
object, which is the given number of characters long. |
void |
updateDate(int columnIndex,
Date columnValue)
Updates a column in the current row using a java.sql.Date value.
|
void |
updateDate(String columnName,
Date columnValue)
Updates a column in the current row using a java.sql.Date value.
|
void |
updateDB2Default(int columnIndex)
Updates a column in the current row to the SQL Default.
|
void |
updateDB2Default(String columnName)
Updates a column in the current row to the SQL Default.
|
void |
updateDB2Unassigned(int columnIndex)
Updates a column in the current row to the SQL Unassigned.
|
void |
updateDB2Unassigned(String columnName)
Updates a column in the current row to the SQL Unassigned.
|
void |
updateDBDefault(int columnIndex)
Updates a column in the current row to the SQL Default.
|
void |
updateDBDefault(String columnName)
Updates a column in the current row to the SQL Default.
|
void |
updateDBUnassigned(int columnIndex)
Updates a column in the current row to the SQL Unassigned.
|
void |
updateDBUnassigned(String columnName)
Updates a column in the current row to the SQL Unassigned.
|
void |
updateDouble(int columnIndex,
double columnValue)
Updates a column in the current row using a Java double value.
|
void |
updateDouble(String columnName,
double columnValue)
Updates a column in the current row using a Java double value.
|
void |
updateFloat(int columnIndex,
float columnValue)
Updates a column in the current row using a Java float value.
|
void |
updateFloat(String columnName,
float columnValue)
Updates a column in the current row using a Java float value.
|
void |
updateInt(int columnIndex,
int columnValue)
Updates a column in the current row using a Java int value.
|
void |
updateInt(String columnName,
int columnValue)
Updates a column in the current row using a Java int value.
|
void |
updateLong(int columnIndex,
long columnValue)
Updates a column in the current row using a Java long value.
|
void |
updateLong(String columnName,
long columnValue)
Updates a column in the current row using a Java long value.
|
void |
updateNCharacterStream(int columnIndex,
Reader x)
Updates the designated column with a character stream value.
|
void |
updateNCharacterStream(int columnIndex,
Reader x,
long length)
Updates the designated column with a character stream value, which will have
the specified number of bytes.
|
void |
updateNCharacterStream(String columnLabel,
Reader reader)
Updates the designated column with a character stream value.
|
void |
updateNCharacterStream(String columnLabel,
Reader reader,
long length)
Updates the designated column with a character stream value, which will have
the specified number of bytes.
|
void |
updateNClob(int columnIndex,
Reader reader)
Updates the designated column using the given
Reader
The data will be read from the stream
as needed until end-of-stream is reached. |
void |
updateNClob(int columnIndex,
Reader reader,
long length)
Updates the designated column using the given
Reader
object, which is the given number of characters long. |
void |
updateNClob(String columnLabel,
Reader reader)
Updates the designated column using the given
Reader
object. |
void |
updateNClob(String columnLabel,
Reader reader,
long length)
Updates the designated column using the given
Reader
object, which is the given number of characters long. |
void |
updateNString(int columnIndex,
String nString)
Updates the designated column with a
String value. |
void |
updateNString(String columnName,
String nString)
Updates the designated column with a
String value. |
void |
updateNull(int columnIndex)
Updates a column in the current row using SQL NULL.
|
void |
updateNull(String columnName)
Updates a column in the current row using SQL NULL.
|
void |
updateObject(int columnIndex,
Object columnValue)
Updates a column in the current row using an Object value.
|
void |
updateObject(int columnIndex,
Object columnValue,
int scale)
Updates a column in the current row using an Object value.
|
void |
updateObject(int columnIndex,
Object x,
Object targetSqlType)
Updates the designated column with an Object value.
|
void |
updateObject(int columnIndex,
Object x,
Object targetSqlType,
int scaleOrLength)
Updates the designated column with an Object value.
|
void |
updateObject(String columnName,
Object columnValue)
Updates a column in the current row using an Object value.
|
void |
updateObject(String columnName,
Object columnValue,
int scale)
Updates a column in the current row using an Object value.
|
void |
updateObject(String columnLabel,
Object x,
Object targetSqlType)
Updates the designated column with an Object value.
|
void |
updateObject(String columnLabel,
Object x,
Object targetSqlType,
int scaleOrLength)
Updates the designated column with an Object value.
|
void |
updateRef(int columnIndex,
Ref columnValue)
Updates the value of an SQL REF output parameter as a Ref value.
|
void |
updateRef(String columnName,
Ref columnValue)
Updates the value of an SQL REF output parameter as a Ref value.
|
void |
updateRow()
Updates the database with the new contents of the current
row.
|
void |
updateShort(int columnIndex,
short columnValue)
Updates a column in the current row using a Java short value.
|
void |
updateShort(String columnName,
short columnValue)
Updates a column in the current row using a Java short value.
|
void |
updateString(int columnIndex,
String columnValue)
Updates a column in the current row using a String value.
|
void |
updateString(String columnName,
String columnValue)
Updates a column in the current row using a String value.
|
void |
updateTime(int columnIndex,
Time columnValue)
Updates a column in the current row using a java.sql.Time value.
|
void |
updateTime(String columnName,
Time columnValue)
Updates a column in the current row using a java.sql.Time value.
|
void |
updateTimestamp(int columnIndex,
Timestamp columnValue)
Updates a column in the current row using a java.sql.Timestamp value.
|
void |
updateTimestamp(String columnName,
Timestamp columnValue)
Updates a column in the current row using a java.sql.Timestamp value.
|
boolean |
wasNull()
Indicates if the last column read has the value of SQL NULL.
|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNClob, getNClob, getRowId, getRowId, getSQLXML, getSQLXML, updateNClob, updateNClob, updateRowId, updateRowId, updateSQLXML, updateSQLXML
isWrapperFor, unwrap
public void clearWarnings() throws SQLException
clearWarnings
in interface ResultSet
SQLException
- If an error occurs.public void close() throws SQLException
close
in interface ResultSet
SQLException
- If an error occurs.protected void finalize() throws Throwable
public int findColumn(String columnName) throws SQLException
findColumn
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open
or the column name is not found.public int getConcurrency() throws SQLException
getConcurrency
in interface ResultSet
SQLException
- If the result set is not open.public String getCursorName() throws SQLException
Cursor names are case sensitive. However, when using a cursor name within other SQL positioned UPDATE or DELETE statements, the cursor name will be uppercased. If you use a cursor name with lowercase characters, you need to enclose it in double quotes when referring to it in other SQL statements.
getCursorName
in interface ResultSet
SQLException
- If the result is not open.public int getFetchDirection() throws SQLException
getFetchDirection
in interface ResultSet
SQLException
- If the result is not open.public int getFetchSize() throws SQLException
getFetchSize
in interface ResultSet
SQLException
- If the result is not open.public Statement getStatement() throws SQLException
getStatement
in interface ResultSet
SQLException
- If an error occurs.public int getType() throws SQLException
getType
in interface ResultSet
SQLException
- If the result set is not open.public URL getURL(int columnIndex) throws SQLException
getURL
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed or
the requested conversion is not valid.public URL getURL(String columnName) throws SQLException
getURL
in interface ResultSet
columnName
- The column name.SQLException
- If the statement is not open,
the index is not valid, the parameter name is
not registered as an output parameter,
the statement was not executed or
the requested conversion is not valid.public SQLWarning getWarnings() throws SQLException
getWarnings
in interface ResultSet
SQLException
- If an error occurs.public boolean isClosed() throws SQLException
isClosed
in interface ResultSet
SQLException
public void setFetchDirection(int fetchDirection) throws SQLException
setFetchDirection
in interface ResultSet
fetchDirection
- The fetch direction for processing rows.
Valid values are:
SQLException
- If the result set is not open,
the result set is scrollable
and the input value is not
ResultSet.FETCH_FORWARD,
or the input value is not valid.public void setFetchSize(int fetchSize) throws SQLException
This setting only affects statements that meet the criteria specified in the "block criteria" property. The fetch size is only used if the "block size" property is set to "0".
setFetchSize
in interface ResultSet
fetchSize
- The number of rows. This must be greater than
or equal to 0 and less than or equal to the
maximum rows limit. The default is the
statement's fetch size.SQLException
- If the result set is not open
or the input value is not valid.public String toString()
public boolean absolute(int rowNumber) throws SQLException
Attempting to move any number of positions before the first row positions the cursor to before the first row. Attempting to move beyond the last row positions the cursor after the last row.
If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.
absolute
in interface ResultSet
rowNumber
- The absolute row number. If the absolute row
number is positive, this positions the cursor
with respect to the beginning of the result set.
If the absolute row number is negative, this
positions the cursor with respect to the end
of result set.SQLException
- If the result set is not open,
the result set is not scrollable,
the row number is 0,
or an error occurs.public void afterLast() throws SQLException
afterLast
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not scrollable,
or an error occurs.public void beforeFirst() throws SQLException
beforeFirst
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not scrollable,
or an error occurs.public boolean first() throws SQLException
first
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not scrollable,
or an error occurs.public int getRow() throws SQLException
0 is returned if the cursor is not on a valid row (such as before the first row, after the last row, or on the insert row), or if the result set is empty.
This method may be slow if cursor movement based on the end of the result set is used. Methods such as last(), afterLast() and absolute() with a negative value will move the cursor based on the end of the result set. This method will be slow in these cases because internally the method must get every row to determine how many rows are in the result set before calculating the current row. The system does not know how many rows are in the result set until every row is touched. That is why this method may start at the highest row retrieved so far, then do next() until the last row is retrieved.
Once the maximum number of rows in the result set is determined, it does not change until the result set is closed.
getRow
in interface ResultSet
SQLException
- If the result set is not open.public boolean isAfterLast() throws SQLException
isAfterLast
in interface ResultSet
SQLException
- If the result set is not open.public boolean isBeforeFirst() throws SQLException
isBeforeFirst
in interface ResultSet
SQLException
- If the result set is not open.public boolean isFirst() throws SQLException
isFirst
in interface ResultSet
SQLException
- If the result set is not open.public boolean isLast() throws SQLException
isLast
in interface ResultSet
SQLException
- If the result set is not open.public boolean last() throws SQLException
last
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not scrollable,
or an error occurs.public void moveToCurrentRow() throws SQLException
If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.
moveToCurrentRow
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not scrollable,
or an error occurs.public void moveToInsertRow() throws SQLException
moveToInsertRow
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not scrollable,
the result set is not updatable,
or an error occurs.public boolean next() throws SQLException
next
in interface ResultSet
SQLException
- If the result set is not open,
or an error occurs.public boolean previous() throws SQLException
previous
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not scrollable,
or an error occurs.public void refreshRow() throws SQLException
refreshRow
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not scrollable,
the cursor is not positioned on a row,
the cursor is positioned on the
insert row or an error occurs.public boolean relative(int rowNumber) throws SQLException
Attempting to move beyond the first row positions the cursor before the first row. Attempting to move beyond the last row positions the cursor after the last row.
If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.
relative
in interface ResultSet
rowNumber
- The relative row number. If the relative row
number is positive, this positions the cursor
after the current position. If the relative
row number is negative, this positions the
cursor before the current position. If the
relative row number is 0, then the cursor
position does not change.SQLException
- If the result set is not open,
the result set is not scrollable,
the cursor is not positioned on a valid row,
or an error occurs.public Array getArray(int columnIndex) throws SQLException
getArray
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- Always thrown because DB2 for IBM i does not support arrays.public Array getArray(String columnName) throws SQLException
getArray
in interface ResultSet
columnName
- The column name.SQLException
- Always thrown because DB2 for IBM i does not support arrays.public InputStream getAsciiStream(int columnIndex) throws SQLException
getAsciiStream
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid,
or the requested conversion is not valid.public InputStream getAsciiStream(String columnName) throws SQLException
getAsciiStream
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public BigDecimal getBigDecimal(int columnIndex) throws SQLException
getBigDecimal
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid,
or the requested conversion is not valid.public BigDecimal getBigDecimal(String columnName) throws SQLException
getBigDecimal
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found,
or the requested conversion is not valid.public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
getBigDecimal
in interface ResultSet
columnIndex
- The column index (1-based).scale
- The number of digits after the decimal.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid,
the scale is not valid, or the
requested conversion is not valid.getBigDecimal(int)
public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException
getBigDecimal
in interface ResultSet
columnName
- The column name.scale
- The number of digits after the decimal.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found,
the scale is not valid, or the
requested conversion is not valid.getBigDecimal(String)
public InputStream getBinaryStream(int columnIndex) throws SQLException
getBinaryStream
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public InputStream getBinaryStream(String columnName) throws SQLException
getBinaryStream
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public Blob getBlob(int columnIndex) throws SQLException
getBlob
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public Blob getBlob(String columnName) throws SQLException
getBlob
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public boolean getBoolean(int columnIndex) throws SQLException
getBoolean
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public boolean getBoolean(String columnName) throws SQLException
getBoolean
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public byte getByte(int columnIndex) throws SQLException
getByte
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public byte getByte(String columnName) throws SQLException
getByte
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public byte[] getBytes(int columnIndex) throws SQLException
This can also be used to get values from columns with other types. The values are returned in their native IBM i format. This is not supported for result sets returned by a DatabaseMetaData object.
getBytes
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public byte[] getBytes(String columnName) throws SQLException
This can also be used to get values from columns with other types. The values are returned in their native IBM i format. This is not supported for result sets returned by a DatabaseMetaData object.
getBytes
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public Reader getCharacterStream(int columnIndex) throws SQLException
getCharacterStream
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public Reader getCharacterStream(String columnName) throws SQLException
getCharacterStream
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not valid, or the
requested conversion is not valid.public Clob getClob(int columnIndex) throws SQLException
getClob
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public Clob getClob(String columnName) throws SQLException
getClob
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public Date getDate(int columnIndex) throws SQLException
getDate
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public Date getDate(String columnName) throws SQLException
getDate
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public Date getDate(int columnIndex, Calendar calendar) throws SQLException
getDate
in interface ResultSet
columnIndex
- The column index (1-based).calendar
- The calendar.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid,
the calendar is null, or the
requested conversion is not valid.public Date getDate(String columnName, Calendar calendar) throws SQLException
getDate
in interface ResultSet
columnName
- The column name.calendar
- The calendar.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found,
the calendar is null, or the
requested conversion is not valid.public double getDouble(int columnIndex) throws SQLException
getDouble
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public double getDouble(String columnName) throws SQLException
getDouble
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public float getFloat(int columnIndex) throws SQLException
getFloat
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public float getFloat(String columnName) throws SQLException
getFloat
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public int getInt(int columnIndex) throws SQLException
getInt
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public int getInt(String columnName) throws SQLException
getInt
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public long getLong(int columnIndex) throws SQLException
getLong
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public long getLong(String columnName) throws SQLException
getLong
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public ResultSetMetaData getMetaData() throws SQLException
getMetaData
in interface ResultSet
SQLException
- If an error occurs.public Object getObject(int columnIndex) throws SQLException
getObject
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public Object getObject(String columnName) throws SQLException
getObject
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public Object getObject(int columnIndex, Map typeMap) throws SQLException
getObject
in interface ResultSet
columnIndex
- The column index (1-based).typeMap
- The type map. This is not used.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid,
the type map is null, or the
requested conversion is not valid.public Object getObject(String columnName, Map typeMap) throws SQLException
getObject
in interface ResultSet
columnName
- The column name.typeMap
- The type map. This is not used.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found,
the type map is null, or the
requested conversion is not valid.public Ref getRef(int columnIndex) throws SQLException
getRef
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- Always thrown because DB2 for IBM i does not support structured types.public Ref getRef(String columnName) throws SQLException
getRef
in interface ResultSet
columnName
- The column name.SQLException
- Always thrown because DB2 for IBM i does not support structured types.public short getShort(int columnIndex) throws SQLException
getShort
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public short getShort(String columnName) throws SQLException
getShort
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public String getString(int columnIndex) throws SQLException
getString
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public String getString(String columnName) throws SQLException
getString
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public Time getTime(int columnIndex) throws SQLException
getTime
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public Time getTime(String columnName) throws SQLException
getTime
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public Time getTime(int columnIndex, Calendar calendar) throws SQLException
getTime
in interface ResultSet
columnIndex
- The column index (1-based).calendar
- The calendar.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid,
the calendar is null, or the
requested conversion is not valid.public Time getTime(String columnName, Calendar calendar) throws SQLException
getTime
in interface ResultSet
columnName
- The column name.calendar
- The calendar.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found,
the calendar is null, or the
requested conversion is not valid.public Timestamp getTimestamp(int columnIndex) throws SQLException
getTimestamp
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public Timestamp getTimestamp(String columnName) throws SQLException
getTimestamp
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public Timestamp getTimestamp(int columnIndex, Calendar calendar) throws SQLException
getTimestamp
in interface ResultSet
columnIndex
- The column index (1-based).calendar
- The calendar.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid,
the calendar is null, or the
requested conversion is not valid.public Timestamp getTimestamp(String columnName, Calendar calendar) throws SQLException
getTimestamp
in interface ResultSet
columnName
- The column name.calendar
- The calendar.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found,
the calendar is null, or the
requested conversion is not valid.public InputStream getUnicodeStream(int columnIndex) throws SQLException
getUnicodeStream
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.getCharacterStream(int)
public InputStream getUnicodeStream(String columnName) throws SQLException
getUnicodeStream
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.getCharacterStream(String)
public boolean wasNull() throws SQLException
wasNull
in interface ResultSet
SQLException
- If the result set is not open.public void cancelRowUpdates() throws SQLException
cancelRowUpdates
in interface ResultSet
SQLException
- If the result set is not open
or the result set is not updatable.public void deleteRow() throws SQLException
deleteRow
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the cursor is positioned on the insert row,
or an error occurs.public void insertRow() throws SQLException
insertRow
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on the insert row,
a column that is not nullable was not specified,
or an error occurs.public boolean rowDeleted() throws SQLException
rowDeleted
in interface ResultSet
SQLException
- If an error occurs.public boolean rowInserted() throws SQLException
rowInserted
in interface ResultSet
SQLException
- If an error occurs.public boolean rowUpdated() throws SQLException
rowUpdated
in interface ResultSet
SQLException
- If an error occurs.public void updateArray(int columnIndex, Array columnValue) throws SQLException
updateArray
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null if the value is SQL NULL.SQLException
- Always thrown because DB2 for IBM i does not support arrays.public void updateArray(String columnName, Array columnValue) throws SQLException
updateArray
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null if the value is SQL NULL.SQLException
- Always thrown because DB2 for IBM i does not support arrays.public void updateAsciiStream(int columnIndex, InputStream columnValue, int length) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateAsciiStream
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.length
- The length.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, the
requested conversion is not valid,
the length is not
valid, the input stream does not contain
ASCII characters, or an error happens
while reading the input stream.public void updateAsciiStream(String columnName, InputStream columnValue, int length) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateAsciiStream
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.length
- The length.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, the
requested conversion is not valid,
the length is not valid,
the input stream does not contain
ASCII characters, or an error happens
while reading the input stream.public void updateBigDecimal(int columnIndex, BigDecimal columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateBigDecimal
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateBigDecimal(String columnName, BigDecimal columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateBigDecimal
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateBinaryStream(int columnIndex, InputStream columnValue, int length) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateBinaryStream
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.length
- The length.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid,
the length is not valid, or an error
happens while reading the input stream.public void updateBinaryStream(String columnName, InputStream columnValue, int length) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateBinaryStream
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.length
- The length.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid,
the length is not valid, or an error
happens while reading the input stream.public void updateBoolean(int columnIndex, boolean columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateBoolean
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateBoolean(String columnName, boolean columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateBoolean
in interface ResultSet
columnName
- The column name.columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateBlob(int columnIndex, Blob columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateBlob
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateBlob(String columnName, Blob columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateBlob
in interface ResultSet
columnName
- The column name.columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateByte(int columnIndex, byte columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateByte
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateByte(String columnName, byte columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateByte
in interface ResultSet
columnName
- The column name.columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateBytes(int columnIndex, byte[] columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateBytes
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateBytes(String columnName, byte[] columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateBytes
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateCharacterStream(int columnIndex, Reader columnValue, int length) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateCharacterStream
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.length
- The length.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid,
the length is not valid, or an error
happens while reading the input stream.public void updateCharacterStream(String columnName, Reader columnValue, int length) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateCharacterStream
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.length
- The length.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid,
the length is not valid, or an error
happens while reading the input stream.public void updateClob(int columnIndex, Clob columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateClob
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateClob(String columnName, Clob columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateClob
in interface ResultSet
columnName
- The column name.columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateDate(int columnIndex, Date columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateDate
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateDate(String columnName, Date columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateDate
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateDouble(int columnIndex, double columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateDouble
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateDouble(String columnName, double columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateDouble
in interface ResultSet
columnName
- The column name.columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateFloat(int columnIndex, float columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateFloat
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateFloat(String columnName, float columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateFloat
in interface ResultSet
columnName
- The column name.columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateInt(int columnIndex, int columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateInt
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateInt(String columnName, int columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateInt
in interface ResultSet
columnName
- The column name.columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateLong(int columnIndex, long columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateLong
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateLong(String columnName, long columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateLong
in interface ResultSet
columnName
- The column name.columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateNull(int columnIndex) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateNull
in interface ResultSet
columnIndex
- The column index (1-based).SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateNull(String columnName) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateNull
in interface ResultSet
columnName
- The column name.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateDB2Default(int columnIndex) throws SQLException
columnIndex
- The column index (1-based).SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter.public void updateDBDefault(int columnIndex) throws SQLException
columnIndex
- The column index (1-based).SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter.public void updateDB2Default(String columnName) throws SQLException
columnName
- The column name.SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter.public void updateDBDefault(String columnName) throws SQLException
columnName
- The column name.SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter.public void updateDB2Unassigned(int columnIndex) throws SQLException
columnIndex
- The column index (1-based).SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter.public void updateDBUnassigned(int columnIndex) throws SQLException
columnIndex
- The column index (1-based).SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter.public void updateDB2Unassigned(String columnName) throws SQLException
columnName
- The column name.SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter.public void updateDBUnassigned(String columnName) throws SQLException
columnName
- The column name.SQLException
- If the statement is not open,
the index is not valid, the parameter
is not an input parameter.public void updateObject(int columnIndex, Object columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateObject
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid,
or the requested conversion is not valid.public void updateObject(String columnName, Object columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateObject
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found,
or the requested conversion is not valid.public void updateObject(int columnIndex, Object columnValue, int scale) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateObject
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.scale
- The number of digits after the decimal
if SQL type is DECIMAL or NUMERIC.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid,
the scale is not valid, or the
requested conversion is not valid.public void updateObject(String columnName, Object columnValue, int scale) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateObject
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.scale
- The number of digits after the decimal
if SQL type is DECIMAL or NUMERIC.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found,
the scale is not valid, or the
requested conversion is not valid.public void updateRef(int columnIndex, Ref columnValue) throws SQLException
updateRef
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- Always thrown because DB2 for IBM i does not support REFs.public void updateRef(String columnName, Ref columnValue) throws SQLException
updateRef
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- Always thrown because DB2 for IBM i does not support REFs.public void updateRow() throws SQLException
updateRow
in interface ResultSet
SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the cursor is positioned on the insert row,
or an error occurs.public void updateShort(int columnIndex, short columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateShort
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateShort(String columnName, short columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateShort
in interface ResultSet
columnName
- The column name.columnValue
- The column value.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateString(int columnIndex, String columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateString
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid,
or the requested conversion is not valid.public void updateString(String columnName, String columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateString
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateTime(int columnIndex, Time columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateTime
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateTime(String columnName, Time columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateTime
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public void updateTimestamp(int columnIndex, Timestamp columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateTimestamp
in interface ResultSet
columnIndex
- The column index (1-based).columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column index is not valid, or the
requested conversion is not valid.public void updateTimestamp(String columnName, Timestamp columnValue) throws SQLException
This does not update the database directly. Instead, it updates a copy of the data in memory. Call updateRow() or insertRow() to update the database.
updateTimestamp
in interface ResultSet
columnName
- The column name.columnValue
- The column value or null to update
the value to SQL NULL.SQLException
- If the result set is not open,
the result set is not updatable,
the cursor is not positioned on a row,
the column name is not found, or the
requested conversion is not valid.public int getHoldability() throws SQLException
ResultSet
objectgetHoldability
in interface ResultSet
ResultSet.HOLD_CURSORS_OVER_COMMIT
or ResultSet.CLOSE_CURSORS_AT_COMMIT
The holdability is derived in this order of precedence:
cursor hold
driver property.SQLException
- if a database error occurspublic Reader getNCharacterStream(int columnIndex) throws SQLException
ResultSet
object as a
java.io.Reader
object.
It is intended for use when
accessing NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.getNCharacterStream
in interface ResultSet
columnIndex
- java.io.Reader
object that contains the column
value; if the value is SQL NULL
, the value returned is
null
in the Java programming language.SQLException
- if a database access error occurspublic Reader getNCharacterStream(String columnName) throws SQLException
ResultSet
object as a
java.io.Reader
object.
It is intended for use when
accessing NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.getNCharacterStream
in interface ResultSet
columnName
- the name of the columnjava.io.Reader
object that contains the column
value; if the value is SQL NULL
, the value returned is
null
in the Java programming languageSQLException
- if a database access error occurspublic String getNString(int columnIndex) throws SQLException
ResultSet
object as
a String
in the Java programming language.
It is intended for use when
accessing NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.getNString
in interface ResultSet
columnIndex
- NULL
, the
value returned is null
SQLException
- if a database access error occurspublic String getNString(String columnName) throws SQLException
ResultSet
object as
a String
in the Java programming language.
It is intended for use when
accessing NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.getNString
in interface ResultSet
columnName
- the SQL name of the columnNULL
, the
value returned is null
SQLException
- if a database access error occurspublic void updateNString(int columnIndex, String nString) throws SQLException
String
value.
It is intended for use when updating NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.updateNString
in interface ResultSet
columnIndex
- nString
- the value for the column to be updatedSQLException
- if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; or if a database access error occurspublic void updateNString(String columnName, String nString) throws SQLException
String
value.
It is intended for use when updating NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.updateNString
in interface ResultSet
columnName
- name of the ColumnnString
- the value for the column to be updatedSQLException
- if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; or if a database access error occursprotected String[] getValidWrappedList()
public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException
updateRow
or
insertRow
methods are called to update the database.updateAsciiStream
in interface ResultSet
columnIndex
- x
- the new column valuelength
- the length of the streamSQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException
updateRow
or
insertRow
methods are called to update the database.updateAsciiStream
in interface ResultSet
columnLabel
- the column namex
- the new column valuelength
- the length of the streamSQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException
updateRow
or
insertRow
methods are called to update the database.updateBinaryStream
in interface ResultSet
columnIndex
- x
- the new column valuelength
- the length of the streamSQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException
updateRow
or
insertRow
methods are called to update the database.updateBinaryStream
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnx
- the new column valuelength
- the length of the streamSQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException
LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream
. Data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from ASCII to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
updateBlob
in interface ResultSet
columnIndex
- inputStream
- An object that contains the data to set the parameter
value to.length
- the number of bytes in the parameter data.SQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException
LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.InputStream
. Data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from ASCII to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
updateBlob
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columninputStream
- An object that contains the data to set the parameter
value to.length
- the number of bytes in the parameter data.SQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException
updateRow
or
insertRow
methods are called to update the database.updateCharacterStream
in interface ResultSet
columnIndex
- x
- the new column valuelength
- the length of the streamSQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException
updateRow
or
insertRow
methods are called to update the database.updateCharacterStream
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnreader
- the new column valuelength
- the length of the streamSQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateClob(int columnIndex, Reader reader, long length) throws SQLException
Reader
object, which is the given number of characters long.
When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader
object. The data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
updateClob
in interface ResultSet
columnIndex
- reader
- An object that contains the data to set the parameter value to.length
- the number of characters in the parameter data.SQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateClob(String columnLabel, Reader reader, long length) throws SQLException
Reader
object, which is the given number of characters long.
When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader
object. The data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
updateClob
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnreader
- An object that contains the data to set the parameter value to.length
- the number of characters in the parameter data.SQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException
NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.updateNCharacterStream
in interface ResultSet
columnIndex
- x
- the new column valuelength
- the length of the streamSQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException
NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.updateNCharacterStream
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnreader
- the java.io.Reader
object containing
the new column valuelength
- the length of the streamSQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateNClob(int columnIndex, Reader reader, long length) throws SQLException
Reader
object, which is the given number of characters long.
When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader
object. The data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
updateNClob
in interface ResultSet
columnIndex
- reader
- An object that contains the data to set the parameter value to.length
- the number of characters in the parameter data.SQLException
- if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; this method is called on a closed result set,
if a database access error occurs or
the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateNClob(String columnLabel, Reader reader, long length) throws SQLException
Reader
object, which is the given number of characters long.
When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a
java.io.Reader
object. The data will be read from the stream
as needed until end-of-file is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
updateNClob
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnreader
- An object that contains the data to set the parameter value to.length
- the number of characters in the parameter data.SQLException
- if a database access error occurs,
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateAsciiStream(int columnIndex, InputStream x) throws SQLException
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateAsciiStream
which takes a length parameter.
updateAsciiStream
in interface ResultSet
columnIndex
- x
- the new column valueSQLException
- if the columnIndex is not valid;
if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateAsciiStream(String columnLabel, InputStream x) throws SQLException
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateAsciiStream
which takes a length parameter.
updateAsciiStream
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnx
- the new column valueSQLException
- if the columnLabel is not valid;
if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateBinaryStream(int columnIndex, InputStream x) throws SQLException
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateBinaryStream
which takes a length parameter.
updateBinaryStream
in interface ResultSet
columnIndex
- x
- the new column valueSQLException
- if the columnIndex is not valid;
if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateBinaryStream(String columnLabel, InputStream x) throws SQLException
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateBinaryStream
which takes a length parameter.
updateBinaryStream
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnx
- the new column valueSQLException
- if the columnLabel is not valid;
if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateBlob(int columnIndex, InputStream inputStream) throws SQLException
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateBlob
which takes a length parameter.
updateBlob
in interface ResultSet
columnIndex
- inputStream
- An object that contains the data to set the parameter
value to.SQLException
- if the columnIndex is not valid; if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateBlob(String columnLabel, InputStream inputStream) throws SQLException
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateBlob
which takes a length parameter.
updateBlob
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columninputStream
- An object that contains the data to set the parameter
value to.SQLException
- if the columnLabel is not valid; if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateCharacterStream(int columnIndex, Reader x) throws SQLException
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateCharacterStream
which takes a length parameter.
updateCharacterStream
in interface ResultSet
columnIndex
- x
- the new column valueSQLException
- if the columnIndex is not valid;
if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateCharacterStream(String columnLabel, Reader reader) throws SQLException
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateCharacterStream
which takes a length parameter.
updateCharacterStream
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnreader
- the java.io.Reader
object containing
the new column valueSQLException
- if the columnLabel is not valid; if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateClob(int columnIndex, Reader reader) throws SQLException
Reader
object.
The data will be read from the stream
as needed until end-of-stream is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateClob
which takes a length parameter.
updateClob
in interface ResultSet
columnIndex
- reader
- An object that contains the data to set the parameter value to.SQLException
- if the columnIndex is not valid;
if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateClob(String columnLabel, Reader reader) throws SQLException
Reader
object.
The data will be read from the stream
as needed until end-of-stream is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateClob
which takes a length parameter.
updateClob
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnreader
- An object that contains the data to set the parameter value to.SQLException
- if the columnLabel is not valid; if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateNCharacterStream(int columnIndex, Reader x) throws SQLException
NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateNCharacterStream
which takes a length parameter.
updateNCharacterStream
in interface ResultSet
columnIndex
- x
- the new column valueSQLException
- if the columnIndex is not valid;
if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException
NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateNCharacterStream
which takes a length parameter.
updateNCharacterStream
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnreader
- the java.io.Reader
object containing
the new column valueSQLException
- if the columnLabel is not valid;
if a database access error occurs;
the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateNClob(int columnIndex, Reader reader) throws SQLException
Reader
The data will be read from the stream as needed until end-of-stream is reached. The JDBC driver will do any necessary conversion from UNICODE to the database char format.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateNClob
which takes a length parameter.
updateNClob
in interface ResultSet
columnIndex
- reader
- An object that contains the data to set the parameter value to.SQLException
- if the columnIndex is not valid;
if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; this method is called on a closed result set,
if a database access error occurs or
the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic void updateNClob(String columnLabel, Reader reader) throws SQLException
Reader
object.
The data will be read from the stream
as needed until end-of-stream is reached. The JDBC driver will
do any necessary conversion from UNICODE to the database char format.
The updater methods are used to update column values in the
current row or the insert row. The updater methods do not
update the underlying database; instead the updateRow
or
insertRow
methods are called to update the database.
Note: Consult your JDBC driver documentation to determine if
it might be more efficient to use a version of
updateNClob
which takes a length parameter.
updateNClob
in interface ResultSet
columnLabel
- the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columnreader
- An object that contains the data to set the parameter value to.SQLException
- if the columnLabel is not valid; if the driver does not support national
character sets; if the driver can detect that a data conversion
error could occur; this method is called on a closed result set;
if a database access error occurs or
the result set concurrency is CONCUR_READ_ONLY
SQLFeatureNotSupportedException
- if the JDBC driver does not support
this methodpublic Object getObject(int columnIndex, Class type) throws SQLException
SQLException
public Object getObject(String columnLabel, Class type) throws SQLException
At a minimum, an implementation must support the conversions defined in Appendix B, Table B-3 and conversion of appropriate user defined SQL types to a Java type which implements SQLData, or Struct. Additional conversions may be supported and are vendor defined.
columnLabel
- - the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the columntype
- - Class representing the Java data type to convert the designated column to.SQLException
- - if conversion is not supported, type is null or another error occurs. The getCause() method of the exception may provide a more detailed exception, for example, if a conversion error occursSQLFeatureNotSupportedException
- - if the JDBC driver does not support this methodprotected void addSavedException(SQLException savedException)
public void updateObject(int columnIndex, Object x, Object targetSqlType, int scaleOrLength) throws SQLException
If the second argument is an InputStream then the stream must contain the number of bytes specified by scaleOrLength. If the second argument is a Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will generate a SQLException when the statement is executed.
columnIndex
- - the first column is 1, the second is 2, ...x
- - the new column valuetargetSqlType
- the SQL type to be sent to the databasescaleOrLength
- - for an object of java.math.BigDecimal , this is the
number of digits after the decimal point. For Java Object types InputStream
and Reader, this is the length of the data in the stream or reader. For all
other types, this value will be ignored.SQLException
- - if the columnIndex is not valid; if a database
access error occurs; the result set concurrency is CONCUR_READ_ONLY or
this method is called on a closed result setSQLFeatureNotSupportedException
- - if the JDBC driver does not
support this method; if the JDBC driver does not support this data typepublic void updateObject(String columnLabel, Object x, Object targetSqlType, int scaleOrLength) throws SQLException
If the second argument is an InputStream then the stream must contain number of bytes specified by scaleOrLength. If the second argument is a Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will generate a SQLException when the statement is executed.
columnLabel
- - the label for the column specified with the SQL
AS clause. If the SQL AS clause was not specified, then the label is
the name of the columnx
- - the new column valuetargetSqlType
- - the SQL type to be sent to the databasescaleOrLength
- - for an object of java.math.BigDecimal, this is
the number of digits after the decimal point. For Java Object types
InputStream and Reader, this is the length of the data in the stream or
reader. For all other types, this value will be ignored.SQLException
- - if the columnLabel is not valid; if a database access
error occurs; the result set concurrency is CONCUR_READ_ONLY or this
method is called on a closed result setSQLFeatureNotSupportedException
- - if the JDBC driver does not
support this method; if the JDBC driver does not support this data typepublic void updateObject(int columnIndex, Object x, Object targetSqlType) throws SQLException
columnIndex
- - the first column is 1, the second is 2, ...x
- - the new column valuetargetSqlType
- - the SQL type to be sent to the databaseSQLException
- - if the columnIndex is not valid; if a database
access error occurs; the result set concurrency is CONCUR_READ_ONLY or this
method is called on a closed result setSQLFeatureNotSupportedException
- - if the JDBC driver does not
support this method; if the JDBC driver does not support this data typepublic void updateObject(String columnLabel, Object x, Object targetSqlType) throws SQLException
columnLabel
- - the label for the column specified with the SQL AS
clause. If the SQL AS clause was not specified, then the label is the
name of the columnx
- - the new column valuetargetSqlType
- - the SQL type to be sent to the databaseSQLException
- - if the columnLabel is not valid; if a database
access error occurs; the result set concurrency is CONCUR_READ_ONLY
or this method is called on a closed result setSQLFeatureNotSupportedException
- - if the JDBC driver does
not support this method; if the JDBC driver does not support this
data type