com.ibm.as400.access
Class AS400JDBCRowSet

java.lang.Object
  extended bycom.ibm.as400.access.AS400JDBCRowSet
All Implemented Interfaces:
ResultSet, RowSet, Serializable

public class AS400JDBCRowSet
extends Object
implements RowSet, Serializable

The AS400JDBCRowSet class represents a connected rowset that encapsulates an JDBC result set. The database connection is maintained while in use.

Either the url or dataSourceName property must be set to specify how the database connection is established. The command property must be set to specify how to create the PreparedStatement.

This example creates an AS400JDBCRowSet object, populates it, and then updates its contents.

DriverManager.registerDriver(new AS400JDBCDriver()); AS400JDBCRowSet rowset = new AS400JDBCRowSet("jdbc:as400://mySystem","myUser", "myPassword"); // Set the command used to populate the list. rowset.setCommand("SELECT * FROM MYLIB.DATABASE"); // Populate the rowset. rowset.execute(); // Update the customer balances. while (rowset.next()) { double newBalance = rowset.getDouble("BALANCE") + july_statements.getPurchases(rowset.getString("CUSTNUM")); rowset.updateDouble("BALANCE", newBalance); rowset.updateRow(); }

This example creates an AS400JDBCRowSet object, sets the data source and command parameters and then populates it.

// Get the data source that is registered in JNDI (assumes JNDI environment is set). Context context = new InitialContext(); AS400JDBCDataSource dataSource = (AS400JDBCDataSource) context.lookup("jdbc/customer"); AS400JDBCRowSet rowset = new AS400JDBCRowSet(); rowset.setDataSourceName("jdbc/customer"); rowset.setUsername("myuser"); rowset.setPassword("myPasswd"); // Set the prepared statement and initialize the parameters. rowset.setCommand("SELECT * FROM MYLIBRARY.MYTABLE WHERE STATE = ? AND BALANCE > ?"); rowset.setString(1, "MINNESOTA"); rowset.setDouble(2, MAXIMUM_LIMIT); // Populate the rowset. rowset.execute();

AS400JDBCRowSet objects generate the following events:

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
 
Constructor Summary
AS400JDBCRowSet()
          Constructs a default AS400JDBCRowSet object.
AS400JDBCRowSet(String dataSourceName)
          Constructs an AS400JDBCRowset with the specified dataSourceName.
AS400JDBCRowSet(String url, String username, String password)
          Constructs an AS400JDBCRowSet with the specified parameters.
 
Method Summary
 boolean absolute(int rowNumber)
          Positions the cursor to an absolute row number.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 void addRowSetListener(RowSetListener listener)
          Adds a RowSetListener to the list.
 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 clearParameters()
          Clears the columns for the current row and releases all associated resources.
 void clearWarnings()
          Clears all warnings that have been reported for the result set.
 void close()
          Releases the rowset resources immediately instead of waiting for them to be automatically released.
 void deleteRow()
          Deletes the current row from the result set and the database.
 void execute()
          Executes the command and fills the rowset with data.
protected  void finalize()
          Closes the Statement and Connection.
 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.
 String getCommand()
          Returns the command used by the statement the generate the rowset.
 int getConcurrency()
          Returns the result set concurrency.
 Context getContext()
          Returns the JNDI naming context which provides name-to-object bindings and methods for retrieving and updating naming and directory services.
 String getCursorName()
          Returns the name of the SQL cursor in use by the result set.
 String getDataSourceName()
          Returns the name of the iSeries data source as identified in JNDI.
 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.
 Hashtable getEnvironment()
          Returns a hashtable of standard JNDI environment properties.
 boolean getEscapeProcessing()
          Indicates if escape processing is enabled (default).
 int getFetchDirection()
          Returns the fetch direction.
 int getFetchSize()
          Returns the number of rows to be fetched from the database when more rows are needed.
 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 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.
 int getMaxFieldSize()
          Returns the maximum column size.
 int getMaxRows()
          Returns the maximum number of rows for the rowset.
 ResultSetMetaData getMetaData()
          Returns the ResultSetMetaData object that describes the result set's columns.
 Object getObject(int columnIndex)
          Returns the value of a column as a Java Object.
 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 columnName, Map typeMap)
          Returns the value of a column as a Java Object.
 String getPassword()
          Returns the password used to create the connection.
 int getQueryTimeout()
          Returns the maximum wait time in seconds for a statement to execute.
 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.
 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 getTransactionIsolation()
          Returns the transaction isolation level.
 int getType()
          Returns the result set type.
 Map getTypeMap()
          Returns the type map.
 InputStream getUnicodeStream(int columnIndex)
          Deprecated. Use getCharacterStream(int) instead.
 InputStream getUnicodeStream(String columnName)
          Deprecated. Use getCharacterStream(String) instead.
 String getUrl()
          Returns the url used in getting a connection.
 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.
 String getUsername()
          Returns the user used to create the connection.
 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 isFirst()
          Indicates if the cursor is positioned on the first row.
 boolean isLast()
          Indicates if the cursor is positioned on the last row.
 boolean isReadOnly()
          Indicates if the rowset is read-only.
 boolean isUseDataSource()
          Indicates if the data source is used to make a connection to the database.
 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.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener.
 void removeRowSetListener(RowSetListener listener)
          Removes the RowSetListener from the list.
 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 setArray(int parameterIndex, Array value)
          Sets the array value at the specified parameterIndex.
 void setAsciiStream(int parameterIndex, InputStream inputStream, int length)
          Sets the inputStream at the specified parameterIndex.
 void setBigDecimal(int parameterIndex, BigDecimal value)
          Sets the BigDecimal value at the specified parameterIndex.
 void setBinaryStream(int parameterIndex, InputStream inputStream, int length)
          Sets the binary stream value using a inputStream at the specified parameterIndex.
 void setBlob(int parameterIndex, Blob value)
          Sets the Blob value at the specified parameterIndex.
 void setBoolean(int parameterIndex, boolean value)
          Sets the boolean value at the specified parameterIndex.
 void setByte(int parameterIndex, byte value)
          Sets the byte value at the specified parameterIndex.
 void setBytes(int parameterIndex, byte[] value)
          Sets the byte array value at the specified parameterIndex.
 void setCharacterStream(int parameterIndex, Reader reader, int length)
          Sets a column in the current row using a Reader value.
 void setClob(int parameterIndex, Clob value)
          Sets the Clob value at the specified parameterIndex.
 void setCommand(String command)
          Sets the command used by the execute statement to populate the rowset.
 void setConcurrency(int concurrency)
          Sets the concurrency type for the result set.
 void setContext(Context context)
          Sets the JNDI naming context which provides name-to-object bindings and methods for retrieving and updating naming and directory services.
 void setDataSourceName(String dataSourceName)
          Sets the name of the iSeries data source.
 void setDate(int parameterIndex, Date value)
          Sets the Date value at the specified parameterIndex.
 void setDate(int parameterIndex, Date value, Calendar calendar)
          Sets the Date value at the specified parameterIndex.
 void setDouble(int parameterIndex, double value)
          Sets the double value at the specified parameterIndex.
 void setEnvironment(Hashtable environment)
          Sets the standard JNDI environment properties.
 void setEscapeProcessing(boolean enable)
          Sets whether the escape scanning is enabled for escape substitution processing.
 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.
 void setFloat(int parameterIndex, float value)
          Sets the float value at the specified parameterIndex.
 void setInt(int parameterIndex, int value)
          Sets the integer value at the specified parameterIndex.
 void setLong(int parameterIndex, long value)
          Sets the long value at the specified parameterIndex.
 void setMaxFieldSize(int maxFieldSize)
          Sets the maximum column size.
 void setMaxRows(int maxRows)
          Sets the maximum row limit for the rowset.
 void setNull(int parameterIndex, int sqlType)
          Sets the type at the specified parameterIndex to SQL NULL.
 void setNull(int parameterIndex, int sqlType, String typeName)
          Sets the user-named type or REF type at the specified parameterIndex to SQL NULL.
 void setObject(int parameterIndex, Object value)
          Sets the object value at the specified parameterIndex.
 void setObject(int parameterIndex, Object value, int targetSqlType)
          Sets the object value at the specified parameterIndex.
 void setObject(int parameterIndex, Object value, int targetSqlType, int scale)
          Sets the object value at the specified parameterIndex.
 void setPassword(String password)
          Sets the password used to make the connection.
 void setQueryTimeout(int timeout)
          Sets the maximum wait time in seconds for a statement to execute.
 void setReadOnly(boolean readOnly)
          Sets whether the rowset is read-only.
 void setRef(int parameterIndex, Ref value)
          Sets Ref value at the specified parameterIndex.
 void setShort(int parameterIndex, short value)
          Sets the short value at the specified parameterIndex.
 void setString(int parameterIndex, String value)
          Sets the string value at the specified parameterIndex.
 void setTime(int parameterIndex, Time value)
          Sets the time value at the specified parameterIndex.
 void setTime(int parameterIndex, Time value, Calendar calendar)
          Sets the time value at the specified parameterIndex.
 void setTimestamp(int parameterIndex, Timestamp value)
          Sets the timestamp value at the specified parameterIndex.
 void setTimestamp(int parameterIndex, Timestamp value, Calendar calendar)
          Sets the timestamp value at the specified parameterIndex.
 void setTransactionIsolation(int level)
          Sets the transaction isolation level.
 void setType(int type)
          Sets the result set type.
 void setTypeMap(Map map)
          Sets the type map to be used for distinct and structured types.
 void setUrl(String url)
          Sets the URL used for getting a connection.
 void setUseDataSource(boolean useDataSource)
          Sets whether the data source is used to make a connection to the database.
 void setUsername(String username)
          Sets the user name used to make the connection.
 String toString()
          Returns the name of the SQL cursor in use by the result set.
 void updateArray(int columnIndex, Array columnValue)
          Updates a column in the current row using an Array value.
 void updateArray(String columnName, Array columnValue)
          Updates a column in the current row using an Array value.
 void updateAsciiStream(int columnIndex, InputStream columnValue, int length)
          Updates a column in the current row using 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 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 columnValue, int length)
          Updates a column in the current row using 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 updateBlob(int columnIndex, Blob columnValue)
          Updates a column in the current row using a Java Blob value.
 void updateBlob(String columnName, Blob columnValue)
          Updates a column in the current row using a Java Blob value.
 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 columnValue, int length)
          Updates a column in the current row using a Reader value.
 void updateCharacterStream(String columnName, Reader columnValue, int length)
          Updates a column in the current row using a Reader value.
 void updateClob(int columnIndex, Clob columnValue)
          Updates a column in the current row using a Java Clob value.
 void updateClob(String columnName, Clob columnValue)
          Updates a column in the current row using a Java Clob value.
 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 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 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(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 updateRef(int columnIndex, Ref columnValue)
          Updates a column in the current row using an Ref value.
 void updateRef(String columnName, Ref columnValue)
          Updates a column in the current row using an 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.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AS400JDBCRowSet

public AS400JDBCRowSet()
Constructs a default AS400JDBCRowSet object.


AS400JDBCRowSet

public AS400JDBCRowSet(String dataSourceName)
Constructs an AS400JDBCRowset with the specified dataSourceName.

Parameters:
dataSourceName - The name of the data source used to make the connection.

AS400JDBCRowSet

public AS400JDBCRowSet(String url,
                       String username,
                       String password)
Constructs an AS400JDBCRowSet with the specified parameters.

Parameters:
url - The url used to make the connection.
username - The user name.
password - The password.
Method Detail

absolute

public boolean absolute(int rowNumber)
                 throws SQLException
Positions the cursor to an absolute row number.

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.

Specified by:
absolute in interface ResultSet
Parameters:
rowNumber - The absolute row number (1-based). 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.
Returns:
true if the requested cursor position is valid; false otherwise.
Throws:
SQLException - If the result set is not open, the result set is not scrollable, the row number is 0, or an error occurs.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener.

Parameters:
listener - The PropertyChangeListener.
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

addRowSetListener

public void addRowSetListener(RowSetListener listener)
Adds a RowSetListener to the list.

Specified by:
addRowSetListener in interface RowSet
Parameters:
listener - The RowSetListener object.

afterLast

public void afterLast()
               throws SQLException
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.

Specified by:
afterLast in interface ResultSet
Throws:
SQLException - If the result set is not open, the result set is not scrollable, or an error occurs.

beforeFirst

public void beforeFirst()
                 throws SQLException
Positions the cursor before the first row. If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.

Specified by:
beforeFirst in interface ResultSet
Throws:
SQLException - If the result set is not open, the result set is not scrollable, or an error occurs.

cancelRowUpdates

public void cancelRowUpdates()
                      throws SQLException
Cancels all pending updates that have been made since the last call to updateRow(). If no updates have been made or updateRow() has already been called, then this method has no effect.

Specified by:
cancelRowUpdates in interface ResultSet
Throws:
SQLException - If the result set is not open or the result set is not updatable.

clearParameters

public void clearParameters()
                     throws SQLException
Clears the columns for the current row and releases all associated resources.

Specified by:
clearParameters in interface RowSet
Throws:
SQLException - If a database error occurs.

clearWarnings

public void clearWarnings()
                   throws SQLException
Clears all warnings that have been reported for the result set. After this call, getWarnings() returns null until a new warning is reported for the result set.

Specified by:
clearWarnings in interface ResultSet
Throws:
SQLException - If an error occurs.

close

public void close()
           throws SQLException
Releases the rowset resources immediately instead of waiting for them to be automatically released. This closes the connection to the database.

Specified by:
close in interface ResultSet
Throws:
SQLException - If an error occurs.

deleteRow

public void deleteRow()
               throws SQLException
Deletes the current row from the result set and the database. After deleting a row, the cursor position is no longer valid, so it must be explicitly repositioned.

Specified by:
deleteRow in interface ResultSet
Throws:
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.

execute

public void execute()
             throws SQLException
Executes the command and fills the rowset with data. Any previous contents are erased. The following properties may be used to create a connection for reading data: The following properties may be used to create a statement to execute a command:

Specified by:
execute in interface RowSet
Throws:
SQLException - If a database error occurs.

finalize

protected void finalize()
                 throws SQLException
Closes the Statement and Connection.

Throws:
SQLException - If a database error occurs.

findColumn

public int findColumn(String columnName)
               throws SQLException
Returns the column index for the specified column name.

Specified by:
findColumn in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column index (1-based).
Throws:
SQLException - If the result set is not open or the column name is not found.

first

public boolean first()
              throws SQLException
Positions the cursor to the first row. If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.

Specified by:
first in interface ResultSet
Returns:
true if the requested cursor position is valid; false otherwise.
Throws:
SQLException - If the result set is not open, the result set is not scrollable, or an error occurs.

getArray

public Array getArray(int columnIndex)
               throws SQLException
Returns the value of a column as an Array object. DB2 UDB for iSeries does not support arrays.

Specified by:
getArray in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
SQLException - Always thrown because DB2 UDB for iSeries does not support arrays.

getArray

public Array getArray(String columnName)
               throws SQLException
Returns the value of a column as an Array object. DB2 UDB for iSeries does not support arrays.

Specified by:
getArray in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
SQLException - Always thrown because DB2 UDB for iSeries does not support arrays.

getAsciiStream

public InputStream getAsciiStream(int columnIndex)
                           throws SQLException
Returns the value of a column as a stream of ASCII characters. This can be used to get values from columns with SQL types CHAR, VARCHAR, BINARY, VARBINARY, CLOB, and BLOB. All of the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getAsciiStream in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getAsciiStream

public InputStream getAsciiStream(String columnName)
                           throws SQLException
Returns the value of a column as a stream of ASCII characters. This can be used to get values from columns with SQL types CHAR, VARCHAR, BINARY, VARBINARY, CLOB, and BLOB. All of the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getAsciiStream in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getBigDecimal

public BigDecimal getBigDecimal(int columnIndex)
                         throws SQLException
Returns the value of a column as a BigDecimal object. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getBigDecimal in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getBigDecimal

public BigDecimal getBigDecimal(String columnName)
                         throws SQLException
Returns the value of a column as a BigDecimal object. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getBigDecimal in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getBigDecimal

public BigDecimal getBigDecimal(int columnIndex,
                                int scale)
                         throws SQLException
Deprecated. Use getBigDecimal(int) instead.

Returns the value of a column as a BigDecimal object. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getBigDecimal in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
scale - The number of digits after the decimal.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.
See Also:
getBigDecimal(int)

getBigDecimal

public BigDecimal getBigDecimal(String columnName,
                                int scale)
                         throws SQLException
Deprecated. Use getBigDecimal(String) instead.

Returns the value of a column as a BigDecimal object. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getBigDecimal in interface ResultSet
Parameters:
columnName - The column name.
scale - The number of digits after the decimal.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.
See Also:
getBigDecimal(String)

getBinaryStream

public InputStream getBinaryStream(int columnIndex)
                            throws SQLException
Returns the value of a column as a stream of uninterpreted bytes. This can be used to get values from columns with SQL types BINARY, VARBINARY, and BLOB. All of the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getBinaryStream in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getBinaryStream

public InputStream getBinaryStream(String columnName)
                            throws SQLException
Returns the value of a column as a stream of uninterpreted bytes. This can be used to get values from columns with SQL types BINARY, VARBINARY, and BLOB. All of the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getBinaryStream in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getBlob

public Blob getBlob(int columnIndex)
             throws SQLException
Returns the value of a column as a Blob object. This can be used to get values from columns with SQL types BINARY, VARBINARY, and BLOB.

Specified by:
getBlob in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getBlob

public Blob getBlob(String columnName)
             throws SQLException
Returns the value of a column as a Blob object. This can be used to get values from columns with SQL types BINARY, VARBINARY, and BLOB.

Specified by:
getBlob in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getBoolean

public boolean getBoolean(int columnIndex)
                   throws SQLException
Returns the value of a column as a Java boolean value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getBoolean in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or false if the value is SQL NULL.
Throws:
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.

getBoolean

public boolean getBoolean(String columnName)
                   throws SQLException
Returns the value of a column as a Java boolean value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getBoolean in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or false if the value is SQL NULL.
Throws:
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.

getByte

public byte getByte(int columnIndex)
             throws SQLException
Returns the value of a column as a Java byte value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getByte in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getByte

public byte getByte(String columnName)
             throws SQLException
Returns the value of a column as a Java byte value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getByte in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getBytes

public byte[] getBytes(int columnIndex)
                throws SQLException
Returns the value of a column as a Java byte array. This can be used to get values from columns with SQL types BINARY and VARBINARY.

This can also be used to get values from columns with other types. The values are returned in their native i5/OS format. This is not supported for result sets returned by a DatabaseMetaData object.

Specified by:
getBytes in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getBytes

public byte[] getBytes(String columnName)
                throws SQLException
Returns the value of a column as a Java byte array. This can be used to get values from columns with SQL types BINARY and VARBINARY.

This can also be used to get values from columns with other types. The values are returned in their native i5/OS format. This is not supported for result sets returned by a DatabaseMetaData object.

Specified by:
getBytes in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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

public Reader getCharacterStream(int columnIndex)
                          throws SQLException
Returns the value of a column as a character stream. This can be used to to get values from columns with SQL types CHAR, VARCHAR, BINARY, VARBINARY, CLOB, and BLOB. All of the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getCharacterStream in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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

public Reader getCharacterStream(String columnName)
                          throws SQLException
Returns the value of a column as a character stream. This can be used to to get values from columns with SQL types CHAR, VARCHAR, BINARY, VARBINARY, CLOB, and BLOB. All of the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getCharacterStream in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getClob

public Clob getClob(int columnIndex)
             throws SQLException
Returns the value of a column as a Clob object. This can be used to get values from columns with SQL types CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and CLOB.

Specified by:
getClob in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getClob

public Clob getClob(String columnName)
             throws SQLException
Returns the value of a column as a Clob object. This can be used to get values from columns with SQL types CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and CLOB.

Specified by:
getClob in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getCommand

public String getCommand()
Returns the command used by the statement the generate the rowset. This should be set before calling the execute method.

Specified by:
getCommand in interface RowSet
Returns:
The command. The default value is null.

getConcurrency

public int getConcurrency()
                   throws SQLException
Returns the result set concurrency.

Specified by:
getConcurrency in interface ResultSet
Returns:
The result set concurrency. Valid values are:
  • ResultSet.CONCUR_READ_ONLY
  • ResultSet.CONCUR_UPDATABLE
Throws:
SQLException - If the result set is not open.

getContext

public Context getContext()
Returns the JNDI naming context which provides name-to-object bindings and methods for retrieving and updating naming and directory services.

Returns:
The context or null if the value has not been set.

getCursorName

public String getCursorName()
                     throws SQLException
Returns the name of the SQL cursor in use by the result set. In SQL, results are retrieved through a named cursor. The current row of a result can be updated or deleted using a positioned UPDATE or DELETE statement that references a cursor name.

Specified by:
getCursorName in interface ResultSet
Returns:
The cursor name.
Throws:
SQLException - If the result is not open.

getDataSourceName

public String getDataSourceName()
Returns the name of the iSeries data source as identified in JNDI.

Specified by:
getDataSourceName in interface RowSet
Returns:
The data source name. The default value is null.

getDate

public Date getDate(int columnIndex)
             throws SQLException
Returns the value of a column as a java.sql.Date object using the default calendar. This can be used to get values from columns with SQL types CHAR, VARCHAR, DATE, and TIMESTAMP.

Specified by:
getDate in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getDate

public Date getDate(String columnName)
             throws SQLException
Returns the value of a column as a java.sql.Date object using the default calendar. This can be used to get values from columns with SQL types CHAR, VARCHAR, DATE, and TIMESTAMP.

Specified by:
getDate in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getDate

public Date getDate(int columnIndex,
                    Calendar calendar)
             throws SQLException
Returns the value of a column as a java.sql.Date object using a calendar other than the default. This can be used to get values from columns with SQL types CHAR, VARCHAR, DATE, and TIMESTAMP.

Specified by:
getDate in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
calendar - The calendar.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getDate

public Date getDate(String columnName,
                    Calendar calendar)
             throws SQLException
Returns the value of a column as a java.sql.Date object using a calendar other than the default. This can be used to get values from columns with SQL types CHAR, VARCHAR, DATE, and TIMESTAMP.

Specified by:
getDate in interface ResultSet
Parameters:
columnName - The column name.
calendar - The calendar.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getDouble

public double getDouble(int columnIndex)
                 throws SQLException
Returns the value of a column as a Java double value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getDouble in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getDouble

public double getDouble(String columnName)
                 throws SQLException
Returns the value of a column as a Java double value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getDouble in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getEnvironment

public Hashtable getEnvironment()
Returns a hashtable of standard JNDI environment properties.

Returns:
The environment properties or null if the value has not been set.

getEscapeProcessing

public boolean getEscapeProcessing()
Indicates if escape processing is enabled (default). If enabled, escape substitution is done before committing the data.

Specified by:
getEscapeProcessing in interface RowSet
Returns:
true if enabled; false otherwise.

getFetchDirection

public int getFetchDirection()
                      throws SQLException
Returns the fetch direction.

Specified by:
getFetchDirection in interface ResultSet
Returns:
The fetch direction. Valid values are:
  • ResultSet.FETCH_FORWARD (default)
  • ResultSet.FETCH_REVERSE
  • ResultSet.FETCH_UNKNOWN
Throws:
SQLException - If the result is not open.

getFetchSize

public int getFetchSize()
                 throws SQLException
Returns the number of rows to be fetched from the database when more rows are needed. The number of rows specified only affects result sets created using this statement. If the value specified is zero, then the driver will choose an appropriate fetch size. 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".

Specified by:
getFetchSize in interface ResultSet
Returns:
The fetch size.
Throws:
SQLException - If the result is not open.

getFloat

public float getFloat(int columnIndex)
               throws SQLException
Returns the value of a column as a Java float value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getFloat in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getFloat

public float getFloat(String columnName)
               throws SQLException
Returns the value of a column as a Java float value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getFloat in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getInt

public int getInt(int columnIndex)
           throws SQLException
Returns the value of a column as a Java int value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getInt in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getInt

public int getInt(String columnName)
           throws SQLException
Returns the value of a column as a Java int value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getInt in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getLong

public long getLong(int columnIndex)
             throws SQLException
Returns the value of a column as a Java long value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getLong in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getLong

public long getLong(String columnName)
             throws SQLException
Returns the value of a column as a Java long value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getLong in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getMaxFieldSize

public int getMaxFieldSize()
                    throws SQLException
Returns the maximum column size. This property is only used with column types:

Specified by:
getMaxFieldSize in interface RowSet
Returns:
The maximum size. The default zero of zero indicates no maximum.
Throws:
SQLException - If a database error occurs.

getMaxRows

public int getMaxRows()
               throws SQLException
Returns the maximum number of rows for the rowset.

Specified by:
getMaxRows in interface RowSet
Returns:
The maximum. The default value of zero indicates no maximum.
Throws:
SQLException - If a database error occurs.

getMetaData

public ResultSetMetaData getMetaData()
                              throws SQLException
Returns the ResultSetMetaData object that describes the result set's columns.

Specified by:
getMetaData in interface ResultSet
Returns:
The metadata object.
Throws:
SQLException - If an error occurs.

getObject

public Object getObject(int columnIndex)
                 throws SQLException
Returns the value of a column as a Java Object. This can be used to get values from columns with all SQL types. If the column is a user-defined type, then the connection's type map is used to created the object.

Specified by:
getObject in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getObject

public Object getObject(String columnName)
                 throws SQLException
Returns the value of a column as a Java Object. This can be used to get values from columns with all SQL types. If the column is a user-defined type, then the connection's type map is used to created the object.

Specified by:
getObject in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getObject

public Object getObject(int columnIndex,
                        Map typeMap)
                 throws SQLException
Returns the value of a column as a Java Object.

Specified by:
getObject in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
typeMap - The type map. This is not used.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getObject

public Object getObject(String columnName,
                        Map typeMap)
                 throws SQLException
Returns the value of a column as a Java Object.

Specified by:
getObject in interface ResultSet
Parameters:
columnName - The column name.
typeMap - The type map. This is not used.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getPassword

public String getPassword()
Returns the password used to create the connection.

Specified by:
getPassword in interface RowSet
Returns:
An empty String. For security the password information cannot be accessed.

getQueryTimeout

public int getQueryTimeout()
                    throws SQLException
Returns the maximum wait time in seconds for a statement to execute.

Specified by:
getQueryTimeout in interface RowSet
Returns:
The timeout value in seconds. The default value of zero indicates no maximum.
Throws:
SQLException - If a database error occurs.

getRef

public Ref getRef(int columnIndex)
           throws SQLException
Returns the value of a column as a Ref object. DB2 UDB for iSeries does not support structured types.

Specified by:
getRef in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
SQLException - Always thrown because DB2 UDB for iSeries does not support structured types.

getRef

public Ref getRef(String columnName)
           throws SQLException
Returns the value of a column as a Ref object. DB2 UDB for iSeries does not support structured types.

Specified by:
getRef in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
SQLException - Always thrown because DB2 UDB for iSeries does not support structured types.

getRow

public int getRow()
           throws SQLException
Returns the current row number.

Specified by:
getRow in interface ResultSet
Returns:
The current row number (1-based). If there is no current row or if the cursor is positioned on the insert row, 0 is returned.
Throws:
SQLException - If the result set is not open.

getShort

public short getShort(int columnIndex)
               throws SQLException
Returns the value of a column as a Java short value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getShort in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getShort

public short getShort(String columnName)
               throws SQLException
Returns the value of a column as a Java short value. This can be used to get values from columns with SQL types SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, CHAR, and VARCHAR.

Specified by:
getShort in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or 0 if the value is SQL NULL.
Throws:
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.

getStatement

public Statement getStatement()
                       throws SQLException
Returns the statement for this result set.

Specified by:
getStatement in interface ResultSet
Returns:
The statement for this result set, or null if the result set was returned by a DatabaseMetaData catalog method.
Throws:
SQLException - If an error occurs.

getString

public String getString(int columnIndex)
                 throws SQLException
Returns the value of a column as a String object. This can be used to get values from columns with any SQL type.

Specified by:
getString in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getString

public String getString(String columnName)
                 throws SQLException
Returns the value of a column as a String object. This can be used to get values from columns with any SQL type.

Specified by:
getString in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getTime

public Time getTime(int columnIndex)
             throws SQLException
Returns the value of a column as a java.sql.Time object using the default calendar. This can be used to get values from columns with SQL types CHAR, VARCHAR, TIME, and TIMESTAMP.

Specified by:
getTime in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getTime

public Time getTime(String columnName)
             throws SQLException
Returns the value of a column as a java.sql.Time object using the default calendar. This can be used to get values from columns with SQL types CHAR, VARCHAR, TIME, and TIMESTAMP.

Specified by:
getTime in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getTime

public Time getTime(int columnIndex,
                    Calendar calendar)
             throws SQLException
Returns the value of a column as a java.sql.Time object using a calendar other than the default. This can be used to get values from columns with SQL types CHAR, VARCHAR, TIME, and TIMESTAMP.

Specified by:
getTime in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
calendar - The calendar.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getTime

public Time getTime(String columnName,
                    Calendar calendar)
             throws SQLException
Returns the value of a column as a java.sql.Time object using a calendar other than the default. This can be used to get values from columns with SQL types CHAR, VARCHAR, TIME, and TIMESTAMP.

Specified by:
getTime in interface ResultSet
Parameters:
columnName - The column name.
calendar - The calendar.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getTimestamp

public Timestamp getTimestamp(int columnIndex)
                       throws SQLException
Returns the value of a column as a java.sql.Timestamp object using the default calendar. This can be used to get values from columns with SQL types CHAR, VARCHAR, DATE, and TIMESTAMP.

Specified by:
getTimestamp in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getTimestamp

public Timestamp getTimestamp(String columnName)
                       throws SQLException
Returns the value of a column as a java.sql.Timestamp object using the default calendar. This can be used to get values from columns with SQL types CHAR, VARCHAR, DATE, and TIMESTAMP.

Specified by:
getTimestamp in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getTimestamp

public Timestamp getTimestamp(int columnIndex,
                              Calendar calendar)
                       throws SQLException
Returns the value of a column as a java.sql.Timestamp object using a calendar other than the default. This can be used to get values from columns with SQL types CHAR, VARCHAR, DATE, and TIMESTAMP.

Specified by:
getTimestamp in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
calendar - The calendar.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getTimestamp

public Timestamp getTimestamp(String columnName,
                              Calendar calendar)
                       throws SQLException
Returns the value of a column as a java.sql.Timestamp object using a calendar other than the default. This can be used to get values from columns with SQL types CHAR, VARCHAR, DATE, and TIMESTAMP.

Specified by:
getTimestamp in interface ResultSet
Parameters:
columnName - The column name.
calendar - The calendar.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.

getTransactionIsolation

public int getTransactionIsolation()
Returns the transaction isolation level. Possible values are:

Specified by:
getTransactionIsolation in interface RowSet
Returns:
The transaction isolation level.

getType

public int getType()
            throws SQLException
Returns the result set type.

Specified by:
getType in interface ResultSet
Returns:
The result set type. Valid values are:
  • ResultSet.TYPE_FORWARD_ONLY
  • ResultSet.TYPE_SCROLL_INSENSITIVE
  • ResultSet.TYPE_SCROLL_SENSITIVE
Throws:
SQLException - If the result set is not open.

getTypeMap

public Map getTypeMap()
               throws SQLException
Returns the type map.

Specified by:
getTypeMap in interface RowSet
Returns:
The type map. The default value is null.
Throws:
SQLException - If a database error occurs.

getUnicodeStream

public InputStream getUnicodeStream(int columnIndex)
                             throws SQLException
Deprecated. Use getCharacterStream(int) instead.

Returns the value of a column as a stream of Unicode characters. This can be used to get values from columns with SQL types CHAR, VARCHAR, BINARY, VARBINARY, CLOB, and BLOB. All of the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getUnicodeStream in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.
See Also:
getCharacterStream(int)

getUnicodeStream

public InputStream getUnicodeStream(String columnName)
                             throws SQLException
Deprecated. Use getCharacterStream(String) instead.

Returns the value of a column as a stream of Unicode characters. This can be used to get values from columns with SQL types CHAR, VARCHAR, BINARY, VARBINARY, CLOB, and BLOB. All of the data in the returned stream must be read prior to getting the value of any other column. The next call to a get method implicitly closes the stream.

Specified by:
getUnicodeStream in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The column value or null if the value is SQL NULL.
Throws:
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.
See Also:
getCharacterStream(String)

getUrl

public String getUrl()
Returns the url used in getting a connection. Either this property or the dataSource property must be set before calling the execute command.

Specified by:
getUrl in interface RowSet
Returns:
The url. The default value is null.

getURL

public URL getURL(int columnIndex)
           throws SQLException
Returns the value of an SQL DATALINK output parameter as a java.net.URL object.

Specified by:
getURL in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
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.
Since:
Modification 5

getURL

public URL getURL(String columnName)
           throws SQLException
Returns the value of an SQL DATALINK output parameter as a java.net.URL object.

Specified by:
getURL in interface ResultSet
Parameters:
columnName - The column name.
Returns:
The parameter value or null if the value is SQL NULL.
Throws:
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.

getUsername

public String getUsername()
Returns the user used to create the connection.

Specified by:
getUsername in interface RowSet
Returns:
The user. The default is null.

getWarnings

public SQLWarning getWarnings()
                       throws SQLException
Returns the first warning reported for the result set. Subsequent warnings may be chained to this warning.

Specified by:
getWarnings in interface ResultSet
Returns:
The first warning or null if no warnings have been reported.
Throws:
SQLException - If an error occurs.

insertRow

public void insertRow()
               throws SQLException
Inserts the contents of the insert row into the result set and the database.

Specified by:
insertRow in interface ResultSet
Throws:
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.

isAfterLast

public boolean isAfterLast()
                    throws SQLException
Indicates if the cursor is positioned after the last row.

Specified by:
isAfterLast in interface ResultSet
Returns:
true if the cursor is positioned after the last row; false if the cursor is not positioned after the last row or if the result set contains no rows.
Throws:
SQLException - If the result set is not open.

isBeforeFirst

public boolean isBeforeFirst()
                      throws SQLException
Indicates if the cursor is positioned before the first row.

Specified by:
isBeforeFirst in interface ResultSet
Returns:
true if the cursor is positioned before the first row; false if the cursor is not positioned before the first row or if the result set contains no rows.
Throws:
SQLException - If the result set is not open.

isFirst

public boolean isFirst()
                throws SQLException
Indicates if the cursor is positioned on the first row.

Specified by:
isFirst in interface ResultSet
Returns:
true if the cursor is positioned on the first row; false if the cursor is not positioned on the first row or the row number can not be determined.
Throws:
SQLException - If the result set is not open.

isLast

public boolean isLast()
               throws SQLException
Indicates if the cursor is positioned on the last row.

Specified by:
isLast in interface ResultSet
Returns:
true if the cursor is positioned on the last row; false if the cursor is not positioned on the last row or the row number can not be determined.
Throws:
SQLException - If the result set is not open.

isReadOnly

public boolean isReadOnly()
Indicates if the rowset is read-only.

Specified by:
isReadOnly in interface RowSet
Returns:
true if read-only; false otherwise. The default value is false, allowing updates.

isUseDataSource

public boolean isUseDataSource()
Indicates if the data source is used to make a connection to the database.

Returns:
true if the data source is used; false if the url is used. The default value is true.

last

public boolean last()
             throws SQLException
Positions the cursor to 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.

Specified by:
last in interface ResultSet
Returns:
true if the requested cursor position is valid; false otherwise.
Throws:
SQLException - If the result set is not open, the result set is not scrollable, or an error occurs.

moveToCurrentRow

public void moveToCurrentRow()
                      throws SQLException
Positions the cursor to the current row. This is the row where the cursor was positioned before moving it to the insert row. If the cursor is not on the insert row, then this has no effect.

If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.

Specified by:
moveToCurrentRow in interface ResultSet
Throws:
SQLException - If the result set is not open, the result set is not scrollable, or an error occurs.

moveToInsertRow

public void moveToInsertRow()
                     throws SQLException
Positions the cursor to the insert row. If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.

Specified by:
moveToInsertRow in interface ResultSet
Throws:
SQLException - If the result set is not open, the result set is not scrollable, the result set is not updatable, or an error occurs.

next

public boolean next()
             throws SQLException
Positions the cursor to the next row. If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.

Specified by:
next in interface ResultSet
Returns:
true if the requested cursor position is valid; false if there are no more rows.
Throws:
SQLException - If the result set is not open, or an error occurs.

previous

public boolean previous()
                 throws SQLException
Positions the cursor to the previous row. If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.

Specified by:
previous in interface ResultSet
Returns:
true if the requested cursor position is valid; false otherwise.
Throws:
SQLException - If the result set is not open, the result set is not scrollable, or an error occurs.

refreshRow

public void refreshRow()
                throws SQLException
Refreshes the current row from the database and cancels all pending updates that have been made since the last call to updateRow(). This method provides a way for an application to explicitly refetch a row from the database. If an InputStream from the current row is open, it is implicitly closed. In addition, all warnings and pending updates are cleared.

Specified by:
refreshRow in interface ResultSet
Throws:
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.

relative

public boolean relative(int rowNumber)
                 throws SQLException
Positions the cursor to a relative row number.

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.

Specified by:
relative in interface ResultSet
Parameters:
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.
Returns:
true if the requested cursor position is valid, false otherwise.
Throws:
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.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener.

Parameters:
listener - The PropertyChangeListener.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

removeRowSetListener

public void removeRowSetListener(RowSetListener listener)
Removes the RowSetListener from the list.

Specified by:
removeRowSetListener in interface RowSet
Parameters:
listener - The RowSetListener object.

rowDeleted

public boolean rowDeleted()
                   throws SQLException
Indicates if the current row has been deleted. A result set of type TYPE_SCROLL_INSENSITIVE may contain rows that have been deleted.

Specified by:
rowDeleted in interface ResultSet
Returns:
true if current row has been deleted; false otherwise.
Throws:
SQLException - If an error occurs.

rowInserted

public boolean rowInserted()
                    throws SQLException
Indicates if the current row has been inserted. This driver does not support this method.

Specified by:
rowInserted in interface ResultSet
Returns:
Always false.
Throws:
SQLException - If an error occurs.

rowUpdated

public boolean rowUpdated()
                   throws SQLException
Indicates if the current row has been updated. This driver does not support this method.

Specified by:
rowUpdated in interface ResultSet
Returns:
Always false.
Throws:
SQLException - If an error occurs.

setArray

public void setArray(int parameterIndex,
                     Array value)
              throws SQLException
Sets the array value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setArray in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Array object.
Throws:
SQLException - If a database error occurs.

setAsciiStream

public void setAsciiStream(int parameterIndex,
                           InputStream inputStream,
                           int length)
                    throws SQLException
Sets the inputStream at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method. The driver reads the data from the stream as needed until no more bytes are available. The converts this to an SQL VARCHAR value.

Specified by:
setAsciiStream in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
inputStream - The input stream or null to update the value to SQL NULL.
length - The number of bytes in the stream.
Throws:
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.

setBigDecimal

public void setBigDecimal(int parameterIndex,
                          BigDecimal value)
                   throws SQLException
Sets the BigDecimal value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setBigDecimal in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The BigDecimal object.
Throws:
SQLException - If a database error occurs.

setBinaryStream

public void setBinaryStream(int parameterIndex,
                            InputStream inputStream,
                            int length)
                     throws SQLException
Sets the binary stream value using a inputStream at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method. The driver reads the data from the stream as needed until no more bytes are available. The driver converts this to an SQL VARBINARY value.

Specified by:
setBinaryStream in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
inputStream - The input stream or null to update the value to SQL NULL.
length - The number of bytes in the stream.
Throws:
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.

setBlob

public void setBlob(int parameterIndex,
                    Blob value)
             throws SQLException
Sets the Blob value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setBlob in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Blob object.
Throws:
SQLException - If a database error occurs.

setBoolean

public void setBoolean(int parameterIndex,
                       boolean value)
                throws SQLException
Sets the boolean value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setBoolean in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The boolean value.
Throws:
SQLException - If a database error occurs.

setByte

public void setByte(int parameterIndex,
                    byte value)
             throws SQLException
Sets the byte value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setByte in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The byte value.
Throws:
SQLException - If a database error occurs.

setBytes

public void setBytes(int parameterIndex,
                     byte[] value)
              throws SQLException
Sets the byte array value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setBytes in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The byte array.
Throws:
SQLException - If a database error occurs.

setCharacterStream

public void setCharacterStream(int parameterIndex,
                               Reader reader,
                               int length)
                        throws SQLException
Sets a column in the current row using a Reader value. This parameter is used by the internal statement to populate the rowset via the execute method. The driver reads the data from the Reader as needed until no more characters are available. The driver converts this to an SQL VARCHAR value.

Specified by:
setCharacterStream in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
reader - The reader or null to update the value to SQL NULL.
length - The number of characters in the stream.
Throws:
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.

setClob

public void setClob(int parameterIndex,
                    Clob value)
             throws SQLException
Sets the Clob value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setClob in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Clob object.
Throws:
SQLException - If a database error occurs.

setCommand

public void setCommand(String command)
                throws SQLException
Sets the command used by the execute statement to populate the rowset. This property is required to create the PreparedStatement. Resetting the command creates a new PreparedStatement and clears all existing input parameters.

Specified by:
setCommand in interface RowSet
Parameters:
command - The command.
Throws:
SQLException - If a database error occurs.

setConcurrency

public void setConcurrency(int concurrency)
Sets the concurrency type for the result set. Valid values include:

Specified by:
setConcurrency in interface RowSet
Parameters:
concurrency - The concurrency type.

setContext

public void setContext(Context context)
Sets the JNDI naming context which provides name-to-object bindings and methods for retrieving and updating naming and directory services. If this is not set, a default InitialContext will be created.

Parameters:
context - A JNDI naming context.

setDataSourceName

public void setDataSourceName(String dataSourceName)
Sets the name of the iSeries data source. Note: This property is not supported. The setDataSource method should be used for setting the data source.

Specified by:
setDataSourceName in interface RowSet
Parameters:
dataSourceName - The iSeries data source name.

setDate

public void setDate(int parameterIndex,
                    Date value)
             throws SQLException
Sets the Date value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setDate in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Date object.
Throws:
SQLException - If a database error occurs.

setDate

public void setDate(int parameterIndex,
                    Date value,
                    Calendar calendar)
             throws SQLException
Sets the Date value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setDate in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Date object.
calendar - The Calendar object.
Throws:
SQLException - If a database error occurs.

setDouble

public void setDouble(int parameterIndex,
                      double value)
               throws SQLException
Sets the double value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setDouble in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The double value.
Throws:
SQLException - If a database error occurs.

setEnvironment

public void setEnvironment(Hashtable environment)
Sets the standard JNDI environment properties. If this is not set, a default set of properties will be used.

Parameters:
environment - A Hashtable of JNDI environment properties.

setEscapeProcessing

public void setEscapeProcessing(boolean enable)
                         throws SQLException
Sets whether the escape scanning is enabled for escape substitution processing.

Specified by:
setEscapeProcessing in interface RowSet
Parameters:
enable - true if enabled; false otherwise. The default value is true.
Throws:
SQLException - If a database error occurs.

setFetchDirection

public void setFetchDirection(int fetchDirection)
                       throws SQLException
Sets the direction in which the rows in a result set are processed.

Specified by:
setFetchDirection in interface ResultSet
Parameters:
fetchDirection - The fetch direction for processing rows. Valid values are:
  • ResultSet.FETCH_FORWARD
  • ResultSet.FETCH_REVERSE
  • ResultSet.FETCH_UNKNOWN
The default is the statement's fetch direction.
Throws:
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.

setFetchSize

public void setFetchSize(int fetchSize)
                  throws SQLException
Sets the number of rows to be fetched from the database when more rows are needed. This may be changed at any time. If the value specified is zero, then the driver will choose an appropriate fetch size.

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".

Specified by:
setFetchSize in interface ResultSet
Parameters:
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.
Throws:
SQLException - If the result set is not open or the input value is not valid.

setFloat

public void setFloat(int parameterIndex,
                     float value)
              throws SQLException
Sets the float value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setFloat in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The float value.
Throws:
SQLException - If a database error occurs.

setInt

public void setInt(int parameterIndex,
                   int value)
            throws SQLException
Sets the integer value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setInt in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The integer value.
Throws:
SQLException - If a database error occurs.

setLong

public void setLong(int parameterIndex,
                    long value)
             throws SQLException
Sets the long value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setLong in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The long value.
Throws:
SQLException - If a database error occurs.

setMaxFieldSize

public void setMaxFieldSize(int maxFieldSize)
                     throws SQLException
Sets the maximum column size. The default size is zero indicating no maximum value. This property is only used with column types:

Specified by:
setMaxFieldSize in interface RowSet
Parameters:
maxFieldSize - The maximum column size.
Throws:
SQLException - If a database error occurs.

setMaxRows

public void setMaxRows(int maxRows)
                throws SQLException
Sets the maximum row limit for the rowset. The default value is zero indicating no maximum value.

Specified by:
setMaxRows in interface RowSet
Parameters:
maxRows - The maximum number of rows.
Throws:
SQLException - If a database error occurs.

setNull

public void setNull(int parameterIndex,
                    int sqlType)
             throws SQLException
Sets the type at the specified parameterIndex to SQL NULL. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setNull in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
sqlType - The SQL type.
Throws:
SQLException - If a database error occurs.

setNull

public void setNull(int parameterIndex,
                    int sqlType,
                    String typeName)
             throws SQLException
Sets the user-named type or REF type at the specified parameterIndex to SQL NULL. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setNull in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
sqlType - The SQL type.
typeName - The fully qualified name of an SQL user-named type. This parameter is not used if the type is REF.
Throws:
SQLException - If a database error occurs.

setObject

public void setObject(int parameterIndex,
                      Object value)
               throws SQLException
Sets the object value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setObject in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Object value.
Throws:
SQLException - If a database error occurs.

setObject

public void setObject(int parameterIndex,
                      Object value,
                      int targetSqlType)
               throws SQLException
Sets the object value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setObject in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Object value.
targetSqlType - The SQL type.
Throws:
SQLException - If a database error occurs.

setObject

public void setObject(int parameterIndex,
                      Object value,
                      int targetSqlType,
                      int scale)
               throws SQLException
Sets the object value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setObject in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Object value.
targetSqlType - The SQL type.
scale - The number of digits after the decimal point. This parameter is used only for SQL types Decimal or Numeric.
Throws:
SQLException - If a database error occurs.

setPassword

public void setPassword(String password)
Sets the password used to make the connection. Note: This property has no effect unless the useDataSource property is set to false.

Specified by:
setPassword in interface RowSet
Parameters:
password - The password.

setQueryTimeout

public void setQueryTimeout(int timeout)
                     throws SQLException
Sets the maximum wait time in seconds for a statement to execute.

Specified by:
setQueryTimeout in interface RowSet
Parameters:
timeout - The timeout value in seconds. The default value is zero indicating no maximum value.
Throws:
SQLException - If a database error occurs.

setReadOnly

public void setReadOnly(boolean readOnly)
                 throws SQLException
Sets whether the rowset is read-only. The default value is false indicating updates are allowed.

Specified by:
setReadOnly in interface RowSet
Parameters:
readOnly - true if read-only; false otherwise.
Throws:
SQLException - If a database error occurs.

setRef

public void setRef(int parameterIndex,
                   Ref value)
            throws SQLException
Sets Ref value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setRef in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Ref object.
Throws:
SQLException - If a database error occurs.

setShort

public void setShort(int parameterIndex,
                     short value)
              throws SQLException
Sets the short value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setShort in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The short value.
Throws:
SQLException - If a database error occurs.

setString

public void setString(int parameterIndex,
                      String value)
               throws SQLException
Sets the string value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setString in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The String object.
Throws:
SQLException - If a database error occurs.

setTime

public void setTime(int parameterIndex,
                    Time value)
             throws SQLException
Sets the time value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setTime in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Time object.
Throws:
SQLException - If a database error occurs.

setTime

public void setTime(int parameterIndex,
                    Time value,
                    Calendar calendar)
             throws SQLException
Sets the time value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setTime in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Time object.
calendar - The Calendar object.
Throws:
SQLException - If a database error occurs.

setTimestamp

public void setTimestamp(int parameterIndex,
                         Timestamp value)
                  throws SQLException
Sets the timestamp value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setTimestamp in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Timestamp object.
Throws:
SQLException - If a database error occurs.

setTimestamp

public void setTimestamp(int parameterIndex,
                         Timestamp value,
                         Calendar calendar)
                  throws SQLException
Sets the timestamp value at the specified parameterIndex. This parameter is used by the internal statement to populate the rowset via the execute method.

Specified by:
setTimestamp in interface RowSet
Parameters:
parameterIndex - The parameter index (1-based).
value - The Timestamp object.
calendar - The Calendar object.
Throws:
SQLException - If a database error occurs.

setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws SQLException
Sets the transaction isolation level.

Specified by:
setTransactionIsolation in interface RowSet
Parameters:
level - The transaction isolation level. Possible values are:
  • Connection.TRANSACTION_READ_UNCOMMITTED
  • Connection.TRANSACTION_READ_COMMITTED
  • Connection.TRANSACTION_REPEATABLE_READ
  • Connection.TRANSACTION_SERIALIZABLE
Throws:
SQLException - If a database error occurs.

setType

public void setType(int type)
             throws SQLException
Sets the result set type. Valid values are:

Specified by:
setType in interface RowSet
Parameters:
type - The type.
Throws:
SQLException - If a database error occurs.

setTypeMap

public void setTypeMap(Map map)
                throws SQLException
Sets the type map to be used for distinct and structured types. Note: Distinct types are supported by DB2 UDB for iSeries, but are not externalized by the IBM Toolbox for Java JDBC driver. In other words, distinct types behave as if they are the underlying type. Structured types are not supported by DB2 UDB for iSeries. Consequently, this driver does not support the type map.

Specified by:
setTypeMap in interface RowSet
Parameters:
map - The type map.
Throws:
SQLException - If a database error occurs.

setUrl

public void setUrl(String url)
Sets the URL used for getting a connection. Either this property or the dataSource property must be set before a connection can be made. This sets setUseDataSource to false.

Specified by:
setUrl in interface RowSet
Parameters:
url - The URL.
See Also:
setUseDataSource(boolean)

setUseDataSource

public void setUseDataSource(boolean useDataSource)
Sets whether the data source is used to make a connection to the database.

Parameters:
useDataSource - true if the data source is used; false if the URL is used. The default value is true.

setUsername

public void setUsername(String username)
Sets the user name used to make the connection. Note: This property has no effect unless the useDataSource property is set to false.

Specified by:
setUsername in interface RowSet
Parameters:
username - The user name.

toString

public String toString()
Returns the name of the SQL cursor in use by the result set.

Returns:
The cursor name.

updateArray

public void updateArray(int columnIndex,
                        Array columnValue)
                 throws SQLException
Updates a column in the current row using an Array value. DB2 UDB for iSeries does not support arrays.

Specified by:
updateArray in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null if the value is SQL NULL.
Throws:
SQLException - Always thrown because DB2 UDB for iSeries does not support arrays.
Since:
Modification 5

updateArray

public void updateArray(String columnName,
                        Array columnValue)
                 throws SQLException
Updates a column in the current row using an Array value. DB2 UDB for iSeries does not support arrays.

Specified by:
updateArray in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null if the value is SQL NULL.
Throws:
SQLException - Always thrown because DB2 UDB for iSeries does not support arrays.

updateAsciiStream

public void updateAsciiStream(int columnIndex,
                              InputStream columnValue,
                              int length)
                       throws SQLException
Updates a column in the current row using an ASCII stream value. The driver reads the data from the stream as needed until no more bytes are available. The driver converts this to an SQL VARCHAR value.

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.

Specified by:
updateAsciiStream in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
length - The length.
Throws:
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.

updateAsciiStream

public void updateAsciiStream(String columnName,
                              InputStream columnValue,
                              int length)
                       throws SQLException
Updates a column in the current row using an ASCII stream value. The driver reads the data from the stream as needed until no more bytes are available. The driver converts this to an SQL VARCHAR value.

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.

Specified by:
updateAsciiStream in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
length - The length.
Throws:
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.

updateBigDecimal

public void updateBigDecimal(int columnIndex,
                             BigDecimal columnValue)
                      throws SQLException
Updates a column in the current row using a BigDecimal value. The driver converts this to an SQL NUMERIC value.

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.

Specified by:
updateBigDecimal in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateBigDecimal

public void updateBigDecimal(String columnName,
                             BigDecimal columnValue)
                      throws SQLException
Updates a column in the current row using a BigDecimal value. The driver converts this to an SQL NUMERIC value.

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.

Specified by:
updateBigDecimal in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateBinaryStream

public void updateBinaryStream(int columnIndex,
                               InputStream columnValue,
                               int length)
                        throws SQLException
Updates a column in the current row using a binary stream value. The driver reads the data from the stream as needed until no more bytes are available. The driver converts this to an SQL VARBINARY value.

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.

Specified by:
updateBinaryStream in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
length - The length.
Throws:
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.

updateBinaryStream

public void updateBinaryStream(String columnName,
                               InputStream columnValue,
                               int length)
                        throws SQLException
Updates a column in the current row using a binary stream value. The driver reads the data from the stream as needed until no more bytes are available. The driver converts this to an SQL VARBINARY value.

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.

Specified by:
updateBinaryStream in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
length - The length.
Throws:
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.

updateBlob

public void updateBlob(int columnIndex,
                       Blob columnValue)
                throws SQLException
Updates a column in the current row using a Java Blob value. The driver converts this to an SQL BLOB value.

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.

Specified by:
updateBlob in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value.
Throws:
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.
Since:
Modification 5

updateBlob

public void updateBlob(String columnName,
                       Blob columnValue)
                throws SQLException
Updates a column in the current row using a Java Blob value. The driver converts this to an SQL BLOB value.

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.

Specified by:
updateBlob in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value.
Throws:
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.

updateBoolean

public void updateBoolean(int columnIndex,
                          boolean columnValue)
                   throws SQLException
Updates a column in the current row using a Java boolean value. The driver converts this to an SQL SMALLINT value.

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.

Specified by:
updateBoolean in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value.
Throws:
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.

updateBoolean

public void updateBoolean(String columnName,
                          boolean columnValue)
                   throws SQLException
Updates a column in the current row using a Java boolean value. The driver converts this to an SQL SMALLINT value.

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.

Specified by:
updateBoolean in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value.
Throws:
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.

updateByte

public void updateByte(int columnIndex,
                       byte columnValue)
                throws SQLException
Updates a column in the current row using a Java byte value. The driver converts this to an SQL SMALLINT value.

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.

Specified by:
updateByte in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value.
Throws:
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.

updateByte

public void updateByte(String columnName,
                       byte columnValue)
                throws SQLException
Updates a column in the current row using a Java byte value. The driver converts this to an SQL SMALLINT value.

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.

Specified by:
updateByte in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value.
Throws:
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.

updateBytes

public void updateBytes(int columnIndex,
                        byte[] columnValue)
                 throws SQLException
Updates a column in the current row using a Java byte array value. The driver converts this to an SQL VARBINARY value.

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.

Specified by:
updateBytes in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateBytes

public void updateBytes(String columnName,
                        byte[] columnValue)
                 throws SQLException
Updates a column in the current row using a Java byte array value. The driver converts this to an SQL VARBINARY value.

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.

Specified by:
updateBytes in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateCharacterStream

public void updateCharacterStream(int columnIndex,
                                  Reader columnValue,
                                  int length)
                           throws SQLException
Updates a column in the current row using a Reader value. The driver reads the data from the Reader as needed until no more characters are available. The driver converts this to an SQL VARCHAR value.

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.

Specified by:
updateCharacterStream in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
length - The length.
Throws:
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.

updateCharacterStream

public void updateCharacterStream(String columnName,
                                  Reader columnValue,
                                  int length)
                           throws SQLException
Updates a column in the current row using a Reader value. The driver reads the data from the Reader as needed until no more characters are available. The driver converts this to an SQL VARCHAR value.

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.

Specified by:
updateCharacterStream in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
length - The length.
Throws:
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.

updateClob

public void updateClob(int columnIndex,
                       Clob columnValue)
                throws SQLException
Updates a column in the current row using a Java Clob value. The driver converts this to an SQL CLOB value.

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.

Specified by:
updateClob in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value.
Throws:
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.
Since:
Modification 5

updateClob

public void updateClob(String columnName,
                       Clob columnValue)
                throws SQLException
Updates a column in the current row using a Java Clob value. The driver converts this to an SQL CLOB value.

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.

Specified by:
updateClob in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value.
Throws:
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.

updateDate

public void updateDate(int columnIndex,
                       Date columnValue)
                throws SQLException
Updates a column in the current row using a java.sql.Date value. The driver converts this to an SQL DATE value.

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.

Specified by:
updateDate in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateDate

public void updateDate(String columnName,
                       Date columnValue)
                throws SQLException
Updates a column in the current row using a java.sql.Date value. The driver converts this to an SQL DATE value.

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.

Specified by:
updateDate in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateDouble

public void updateDouble(int columnIndex,
                         double columnValue)
                  throws SQLException
Updates a column in the current row using a Java double value. The driver converts this to an SQL DOUBLE value.

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.

Specified by:
updateDouble in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value.
Throws:
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.

updateDouble

public void updateDouble(String columnName,
                         double columnValue)
                  throws SQLException
Updates a column in the current row using a Java double value. The driver converts this to an SQL DOUBLE value.

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.

Specified by:
updateDouble in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value.
Throws:
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.

updateFloat

public void updateFloat(int columnIndex,
                        float columnValue)
                 throws SQLException
Updates a column in the current row using a Java float value. The driver converts this to an SQL REAL value.

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.

Specified by:
updateFloat in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value.
Throws:
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.

updateFloat

public void updateFloat(String columnName,
                        float columnValue)
                 throws SQLException
Updates a column in the current row using a Java float value. The driver converts this to an SQL REAL value.

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.

Specified by:
updateFloat in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value.
Throws:
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.

updateInt

public void updateInt(int columnIndex,
                      int columnValue)
               throws SQLException
Updates a column in the current row using a Java int value. The driver converts this to an SQL INTEGER value.

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.

Specified by:
updateInt in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value.
Throws:
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.

updateInt

public void updateInt(String columnName,
                      int columnValue)
               throws SQLException
Updates a column in the current row using a Java int value. The driver converts this to an SQL INTEGER value.

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.

Specified by:
updateInt in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value.
Throws:
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.

updateLong

public void updateLong(int columnIndex,
                       long columnValue)
                throws SQLException
Updates a column in the current row using a Java long value. If the connected AS/400 or iSeries server supports SQL BIGINT data, the driver converts this to an SQL BIGINT value. Otherwise, the driver converts this to an SQL INTEGER value. SQL BIGINT data is supported on V4R5 and later.

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.

Specified by:
updateLong in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value.
Throws:
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.

updateLong

public void updateLong(String columnName,
                       long columnValue)
                throws SQLException
Updates a column in the current row using a Java long value. If the connected AS/400 or iSeries server supports SQL BIGINT data, the driver converts this to an SQL BIGINT value. Otherwise, the driver converts this to an SQL INTEGER value. SQL BIGINT data is supported on V4R5 and later.

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.

Specified by:
updateLong in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value.
Throws:
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.

updateNull

public void updateNull(int columnIndex)
                throws SQLException
Updates a column in the current row using SQL NULL.

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.

Specified by:
updateNull in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
Throws:
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.

updateNull

public void updateNull(String columnName)
                throws SQLException
Updates a column in the current row using SQL NULL.

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.

Specified by:
updateNull in interface ResultSet
Parameters:
columnName - The column name.
Throws:
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.

updateObject

public void updateObject(int columnIndex,
                         Object columnValue)
                  throws SQLException
Updates a column in the current row using an Object value. The driver converts this to a value of an SQL type, depending on the type of the specified value. The JDBC specification defines a standard mapping from Java types to SQL types. In the cases where an SQL type is not supported by DB2 UDB for iSeries, the next closest matching type is used.

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.

Specified by:
updateObject in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateObject

public void updateObject(String columnName,
                         Object columnValue)
                  throws SQLException
Updates a column in the current row using an Object value. The driver converts this to a value of an SQL type, depending on the type of the specified value. The JDBC specification defines a standard mapping from Java types to SQL types. In the cases where an SQL type is not supported by DB2 UDB for iSeries, the next closest matching type is used.

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.

Specified by:
updateObject in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateObject

public void updateObject(int columnIndex,
                         Object columnValue,
                         int scale)
                  throws SQLException
Updates a column in the current row using an Object value. The driver converts this to a value of an SQL type, depending on the type of the specified value. The JDBC specification defines a standard mapping from Java types to SQL types. In the cases where an SQL type is not supported by DB2 UDB for iSeries, the next closest matching type is used.

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.

Specified by:
updateObject in interface ResultSet
Parameters:
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.
Throws:
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.

updateObject

public void updateObject(String columnName,
                         Object columnValue,
                         int scale)
                  throws SQLException
Updates a column in the current row using an Object value. The driver converts this to a value of an SQL type, depending on the type of the specified value. The JDBC specification defines a standard mapping from Java types to SQL types. In the cases where an SQL type is not supported by DB2 UDB for iSeries, the next closest matching type is used.

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.

Specified by:
updateObject in interface ResultSet
Parameters:
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.
Throws:
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.

updateRow

public void updateRow()
               throws SQLException
Updates the database with the new contents of the current row.

Specified by:
updateRow in interface ResultSet
Throws:
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.

updateRef

public void updateRef(int columnIndex,
                      Ref columnValue)
               throws SQLException
Updates a column in the current row using an Ref value. DB2 UDB for iSeries does not support structured types.

Specified by:
updateRef in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
SQLException - Always thrown because DB2 UDB for iSeries does not support REFs.
Since:
Modification 5

updateRef

public void updateRef(String columnName,
                      Ref columnValue)
               throws SQLException
Updates a column in the current row using an Ref value. DB2 UDB for iSeries does not support structured types.

Specified by:
updateRef in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
Returns:
The parameter value or 0 if the value is SQL NULL.
Throws:
SQLException - Always thrown because DB2 UDB for iSeries does not support REFs.

updateShort

public void updateShort(int columnIndex,
                        short columnValue)
                 throws SQLException
Updates a column in the current row using a Java short value. The driver converts this to an SQL SMALLINT value.

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.

Specified by:
updateShort in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value.
Throws:
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.

updateShort

public void updateShort(String columnName,
                        short columnValue)
                 throws SQLException
Updates a column in the current row using a Java short value. The driver converts this to an SQL SMALLINT value.

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.

Specified by:
updateShort in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value.
Throws:
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.

updateString

public void updateString(int columnIndex,
                         String columnValue)
                  throws SQLException
Updates a column in the current row using a String value. The driver converts this to an SQL VARCHAR value.

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.

Specified by:
updateString in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateString

public void updateString(String columnName,
                         String columnValue)
                  throws SQLException
Updates a column in the current row using a String value. The driver converts this to an SQL VARCHAR value.

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.

Specified by:
updateString in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateTime

public void updateTime(int columnIndex,
                       Time columnValue)
                throws SQLException
Updates a column in the current row using a java.sql.Time value. The driver converts this to an SQL TIME value.

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.

Specified by:
updateTime in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateTime

public void updateTime(String columnName,
                       Time columnValue)
                throws SQLException
Updates a column in the current row using a java.sql.Time value. The driver converts this to an SQL TIME value.

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.

Specified by:
updateTime in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateTimestamp

public void updateTimestamp(int columnIndex,
                            Timestamp columnValue)
                     throws SQLException
Updates a column in the current row using a java.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP value.

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.

Specified by:
updateTimestamp in interface ResultSet
Parameters:
columnIndex - The column index (1-based).
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

updateTimestamp

public void updateTimestamp(String columnName,
                            Timestamp columnValue)
                     throws SQLException
Updates a column in the current row using a java.sql.Timestamp value. The driver converts this to an SQL TIMESTAMP value.

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.

Specified by:
updateTimestamp in interface ResultSet
Parameters:
columnName - The column name.
columnValue - The column value or null to update the value to SQL NULL.
Throws:
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.

wasNull

public boolean wasNull()
                throws SQLException
Indicates if the last column read has the value of SQL NULL.

Specified by:
wasNull in interface ResultSet
Returns:
true if the value is SQL NULL; false otherwise.
Throws:
SQLException - If the result set is not open.