www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

JDBC Components

OpenLink Drivers for Java Database Connectivity (JDBC)
Downloading Driver Software
OpenLink Drivers for JDBC Installation & Configuration
Java Based Local Client-Server
Java Based Client-Server (2-Tier) Installation
Java Based Application-Server (3-Tier) Installation
OpenLink Server Components Configuration
OpenLink Drivers for JDBC Utilization
OpenLink Demonstration Programs
Important Multi-User JDBC Solution Development & Utilization Issues
JDBC 3 Driver Classes
Class BaseRowSet Class OPLCachedRowSet Class OPLConnectionPoolDataSource Class OPLDataSource Class OPLDataSourceFactory Class OPLJdbcRowSet Class OPLPooledConnection Class OPLPoolStatistic Class OPLRowSetMetaData
New Features

11.11. JDBC 3 Driver Classes

The OpenLink JDBC driver for JDBC 3.0 has the following classes:

11.11.1. Class BaseRowSet

BaseRowSet Classes BaseRowSet

11.11.1.1. Synopsis

abstract public class BaseRowSet implements RowSet,Serializable {
  // Public Constructors
  public BaseRowSet();
  // Public Methods
  public void close() throws java.sql.SQLException;
  public void addRowSetListener(javax.sql.RowSetListener rowsetlistener);
  public void removeRowSetListener(javax.sql.RowSetListener rowsetlistener);
  public void clearParameters() throws java.sql.SQLException;
  public String getCommand();
  public int getConcurrency() throws java.sql.SQLException;
  public String getDataSourceName();
  public boolean getEscapeProcessing() throws java.sql.SQLException;
  public int getFetchDirection() throws java.sql.SQLException;
  public int getFetchSize() throws java.sql.SQLException;
  public int getMaxFieldSize() throws java.sql.SQLException;
  public int getMaxRows() throws java.sql.SQLException;
  public Object[] getParams() throws java.sql.SQLException;
  public String getPassword();
  public int getQueryTimeout() throws java.sql.SQLException;
  public int getTransactionIsolation();
  public int getType() throws java.sql.SQLException;
  public Map getTypeMap() throws java.sql.SQLException;
  public String getUrl() throws java.sql.SQLException;
  public String getUsername();
  public boolean isReadOnly();
  public void setArray(int parameterIndex, java.sql.Array x) 
      throws java.sql.SQLException;
  public void setAsciiStream(int parameterIndex, java.io.InputStream x, 
                             int length) throws java.sql.SQLException;
  public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) 
      throws java.sql.SQLException;
  public void setBinaryStream(int parameterIndex, java.io.InputStream x, 
                              int length) throws java.sql.SQLException;
  public void setBlob(int parameterIndex, java.sql.Blob x) 
      throws java.sql.SQLException;
  public void setBoolean(int parameterIndex, boolean x) 
      throws java.sql.SQLException;
  public void setByte(int parameterIndex, byte x) throws java.sql.SQLException;
  public void setBytes(int parameterIndex, byte[] x) 
      throws java.sql.SQLException;
  public void setCharacterStream(int parameterIndex, java.io.Reader x, 
                                 int length) throws java.sql.SQLException;
  public void setClob(int parameterIndex, java.sql.Clob x) 
      throws java.sql.SQLException;
  public void setDate(int parameterIndex, java.sql.Date x) 
      throws java.sql.SQLException;
  public void setDate(int parameterIndex, java.sql.Date x, 
                      java.util.Calendar cal) throws java.sql.SQLException;
  public void setDouble(int parameterIndex, double x) 
      throws java.sql.SQLException;
  public void setFloat(int parameterIndex, float x) 
      throws java.sql.SQLException;
  public void setInt(int parameterIndex, int x) throws java.sql.SQLException;
  public void setLong(int parameterIndex, long x) throws java.sql.SQLException;
  public void setRef(int parameterIndex, java.sql.Ref x) 
      throws java.sql.SQLException;
  public void setShort(int parameterIndex, short x) 
      throws java.sql.SQLException;
  public void setString(int parameterIndex, java.lang.String x) 
      throws java.sql.SQLException;
  public void setTime(int parameterIndex, java.sql.Time x) 
      throws java.sql.SQLException;
  public void setTime(int parameterIndex, java.sql.Time x, 
                      java.util.Calendar cal) throws java.sql.SQLException;
  public void setTimestamp(int parameterIndex, java.sql.Timestamp x) 
      throws java.sql.SQLException;
  public void setTimestamp(int parameterIndex, java.sql.Timestamp x, 
                           java.util.Calendar cal) 
      throws java.sql.SQLException;
  public void setUnicodeStream(int parameterIndex, java.io.InputStream x, 
                               int length) throws java.sql.SQLException;
  public void setNull(int parameterIndex, int sqlType) 
      throws java.sql.SQLException;
  public void setNull(int parameterIndex, int sqlType, 
                      java.lang.String typeName) throws java.sql.SQLException;
  public void setObject(int parameterIndex, java.lang.Object x) 
      throws java.sql.SQLException;
  public void setObject(int parameterIndex, java.lang.Object x, 
                        int targetSqlType) throws java.sql.SQLException;
  public void setObject(int parameterIndex, java.lang.Object x, 
                        int targetSqlType, int scale) 
      throws java.sql.SQLException;
  public void setCommand(java.lang.String s) throws java.sql.SQLException;
  public void setConcurrency(int i) throws java.sql.SQLException;
  public void setDataSourceName(java.lang.String s) 
      throws java.sql.SQLException;
  public void setEscapeProcessing(boolean flag) throws java.sql.SQLException;
  public void setFetchDirection(int direction) throws java.sql.SQLException;
  public void setFetchSize(int rows) throws java.sql.SQLException;
  public void setMaxFieldSize(int max) throws java.sql.SQLException;
  public void setMaxRows(int max) throws java.sql.SQLException;
  public void setQueryTimeout(int seconds) throws java.sql.SQLException;
  public void setReadOnly(boolean value) throws java.sql.SQLException;
  public void setPassword(java.lang.String s) throws java.sql.SQLException;
  public void setTransactionIsolation(int value) throws java.sql.SQLException;
  public void setType(int value) throws java.sql.SQLException;
  public void setTypeMap(java.util.Map value) throws java.sql.SQLException;
  public void setUrl(java.lang.String s) throws java.sql.SQLException;
  public void setUsername(java.lang.String s) throws java.sql.SQLException;
}
      

Inheritance Path

java.lang.Object

|

openlink.javax.BaseRowSet


11.11.1.2. Members

11.11.1.2.1. Method addRowSetListener(RowSetListener)
addRowSetListener Methods addRowSetListener
Synopsis: public void addRowSetListener(
                        javax.sql.RowSetListener rowsetlistener);
          

Parameters

listener - an event listener


RowSet listener registration. Listeners are notified when an event occurs.


11.11.1.2.2. Method clearParameters()
clearParameters Methods clearParameters
Synopsis: public void clearParameters() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


In general, parameter values remain in force for repeated use of a RowSet. Setting a parameter value automatically clears its previous value. However, in some cases it is useful to immediately release the resources used by the current parameter values; this can be done by calling clearParameters.


11.11.1.2.3. Method getCommand()
getCommand Methods getCommand
Synopsis: public String getCommand();
          

Get the rowset's command property. The command property contains a command string that can be executed to fill the rowset with data. The default value is null.


11.11.1.2.4. Method getConcurrency()
getConcurrency Methods getConcurrency
Synopsis: public int getConcurrency() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


Get the rowset concurrency.


11.11.1.2.5. Method getDataSourceName()
getDataSourceName Methods getDataSourceName
Synopsis: public String getDataSourceName();
          

The JNDI name that identifies a JDBC data source. Users should set either the url or data source name properties. The most recent property set is used to get a connection.


11.11.1.2.6. Method getEscapeProcessing()
getEscapeProcessing Methods getEscapeProcessing
Synopsis: public boolean getEscapeProcessing() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database.


11.11.1.2.7. Method getFetchDirection()
getFetchDirection Methods getFetchDirection
Synopsis: public int getFetchDirection() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs


Determine the fetch direction.


11.11.1.2.8. Method getFetchSize()
getFetchSize Methods getFetchSize
Synopsis: public int getFetchSize() throws java.sql.SQLException;
          

Determine the default fetch size.


11.11.1.2.9. Method getMaxFieldSize()
getMaxFieldSize Methods getMaxFieldSize
Synopsis: public int getMaxFieldSize() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


The maxFieldSize limit (in bytes) is the maximum amount of data returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR columns. If the limit is exceeded, the excess data is silently discarded.


11.11.1.2.10. Method getMaxRows()
getMaxRows Methods getMaxRows
Synopsis: public int getMaxRows() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


The maxRows limit is the maximum number of rows that a RowSet can contain. If the limit is exceeded, the excess rows are silently dropped.


11.11.1.2.11. Method getParams()
getParams Methods getParams
Synopsis: public Object[] getParams() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


Get the parameters that were set on the rowset.


11.11.1.2.12. Method getPassword()
getPassword Methods getPassword
Synopsis: public String getPassword();
          

The password used to create a database connection. The password property is set at runtime before calling execute(). It is not usually part of the serialized state of a rowset object.


11.11.1.2.13. Method getQueryTimeout()
getQueryTimeout Methods getQueryTimeout
Synopsis: public int getQueryTimeout() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute. If the limit is exceeded, a SQLException is thrown.


11.11.1.2.14. Method getTransactionIsolation()
getTransactionIsolation Methods getTransactionIsolation
Synopsis: public int getTransactionIsolation();
          

The transaction isolation property contains the JDBC transaction isolation level used.


11.11.1.2.15. Method getType()
getType Methods getType
Synopsis: public int getType() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs


Return the type of this result set.


11.11.1.2.16. Method getTypeMap()
getTypeMap Methods getTypeMap
Synopsis: public Map getTypeMap() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


Get the type-map object associated with this rowset. By default, the map returned is empty.


11.11.1.2.17. Method getUrl()
getUrl Methods getUrl
Synopsis: public String getUrl() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


Get the url used to create a JDBC connection. The default value is null.


11.11.1.2.18. Method getUsername()
getUsername Methods getUsername
Synopsis: public String getUsername();
          

The username used to create a database connection. The username property is set at runtime before calling execute(). It is not usually part of the serialized state of a rowset object.


11.11.1.2.19. Method isReadOnly()
isReadOnly Methods isReadOnly
Synopsis: public boolean isReadOnly();
          

A rowset may be read-only. Attempts to update a read-only rowset will result in an SQLException being thrown. Rowsets are updateable, by default, if updates are possible.


11.11.1.2.20. Method removeRowSetListener(RowSetListener)
removeRowSetListener Methods removeRowSetListener
Synopsis: public void removeRowSetListener(
                        javax.sql.RowSetListener rowsetlistener);
          

Parameters

listener - an event listener


RowSet listener deregistration.


11.11.1.2.21. Method setArray(int, Array)
setArray Methods setArray
Synopsis: public void setArray(int parameterIndex, java.sql.Array x) 
              throws java.sql.SQLException;
          

Parameters

i - the first parameter is 1, the second is 2, ...

x - an object representing an SQL array


Set an Array parameter.


11.11.1.2.22. Method setAsciiStream(int, InputStream, int)
setAsciiStream Methods setAsciiStream
Synopsis: public void setAsciiStream(int parameterIndex, java.io.InputStream x, 
                                     int length) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the java input stream which contains the ASCII parameter value

length - the number of bytes in the stream


Exceptions

SQLException

if a database-access error occurs.


When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.


11.11.1.2.23. Method setBigDecimal(int, BigDecimal)
setBigDecimal Methods setBigDecimal
Synopsis: public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a java.lang.BigDecimal value.


11.11.1.2.24. Method setBinaryStream(int, InputStream, int)
setBinaryStream Methods setBinaryStream
Synopsis: public void setBinaryStream(int parameterIndex, 
                                      java.io.InputStream x, int length) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the java input stream which contains the binary parameter value

length - the number of bytes in the stream


Exceptions

SQLException

if a database-access error occurs.


When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.


11.11.1.2.25. Method setBlob(int, Blob)
setBlob Methods setBlob
Synopsis: public void setBlob(int parameterIndex, java.sql.Blob x) 
              throws java.sql.SQLException;
          

Parameters

i - the first parameter is 1, the second is 2, ...

x - an object representing a BLOB


Set a BLOB parameter.


11.11.1.2.26. Method setBoolean(int, boolean)
setBoolean Methods setBoolean
Synopsis: public void setBoolean(int parameterIndex, boolean x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a Java boolean value.


11.11.1.2.27. Method setByte(int, byte)
setByte Methods setByte
Synopsis: public void setByte(int parameterIndex, byte x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a Java byte value.


11.11.1.2.28. Method setBytes(int, byte[])
setBytes Methods setBytes
Synopsis: public void setBytes(int parameterIndex, byte[] x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a Java array of bytes.


11.11.1.2.29. Method setCharacterStream(int, Reader, int)
setCharacterStream Methods setCharacterStream
Synopsis: public void setCharacterStream(int parameterIndex, java.io.Reader x, 
                                         int length) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the java reader which contains the UNICODE data

length - the number of characters in the stream


Exceptions

SQLException

if a database-access error occurs.


When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader. JDBC will read the data from the stream as needed, until it reaches end-of-file.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.


11.11.1.2.30. Method setClob(int, Clob)
setClob Methods setClob
Synopsis: public void setClob(int parameterIndex, java.sql.Clob x) 
              throws java.sql.SQLException;
          

Parameters

i - the first parameter is 1, the second is 2, ...

x - an object representing a CLOB


Set a CLOB parameter.


11.11.1.2.31. Method setCommand(String)
setCommand Methods setCommand
Synopsis: public void setCommand(java.lang.String s) 
              throws java.sql.SQLException;
          

Parameters

cmd - a command string, may be null


Exceptions

SQLException

if a database-access error occurs.


Set the rowset's command property. This property is optional. The command property may not be needed when a rowset is produced by a data source that doesn't support commands, such as a spreadsheet.


11.11.1.2.32. Method setConcurrency(int)
setConcurrency Methods setConcurrency
Synopsis: public void setConcurrency(int i) throws java.sql.SQLException;
          

Parameters

concurrency - a value from ResultSet.CONCUR_XXX


Exceptions

SQLException

if a database-access error occurs.


Set the rowset concurrency.


11.11.1.2.33. Method setDataSourceName(String)
setDataSourceName Methods setDataSourceName
Synopsis: public void setDataSourceName(java.lang.String s) 
              throws java.sql.SQLException;
          

Parameters

name - a data source name


Exceptions

SQLException

if a database-access error occurs.


Set the data source name.


11.11.1.2.34. Method setDate(int, Date)
setDate Methods setDate
Synopsis: public void setDate(int parameterIndex, java.sql.Date x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a java.sql.Date value.


11.11.1.2.35. Method setDate(int, Date, Calendar)
setDate Methods setDate
Synopsis: public void setDate(int parameterIndex, java.sql.Date x, 
                              java.util.Calendar cal) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a java.sql.Date value. The driver converts this to a SQL DATE value when it sends it to the database.


11.11.1.2.36. Method setDouble(int, double)
setDouble Methods setDouble
Synopsis: public void setDouble(int parameterIndex, double x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a Java double value.


11.11.1.2.37. Method setEscapeProcessing(boolean)
setEscapeProcessing Methods setEscapeProcessing
Synopsis: public void setEscapeProcessing(boolean flag) 
              throws java.sql.SQLException;
          

Parameters

enable - true to enable; false to disable


Exceptions

SQLException

if a database-access error occurs.


If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database.


11.11.1.2.38. Method setFetchDirection(int)
setFetchDirection Methods setFetchDirection
Synopsis: public void setFetchDirection(int direction) 
              throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs, or the result set type is TYPE_FORWARD_ONLY and direction is not FETCH_FORWARD.


Give a hint as to the direction in which the rows in this result set will be processed. The initial value is determined by the statement that produced the result set. The fetch direction may be changed at any time.


11.11.1.2.39. Method setFetchSize(int)
setFetchSize Methods setFetchSize
Synopsis: public void setFetchSize(int rows) throws java.sql.SQLException;
          

Parameters

rows - the number of rows to fetch


Exceptions

SQLException

if a database-access error occurs, or the condition 0 <= rows <= this.getMaxRows() is not satisfied.


Give the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for this result set. If the fetch size specified is zero, then the JDBC driver ignores the value, and is free to make its own best guess as to what the fetch size should be. The default value is set by the statement that creates the result set. The fetch size may be changed at any time.


11.11.1.2.40. Method setFloat(int, float)
setFloat Methods setFloat
Synopsis: public void setFloat(int parameterIndex, float x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a Java float value. The driver converts this to a SQL FLOAT value when it sends it to the database.


11.11.1.2.41. Method setInt(int, int)
setInt Methods setInt
Synopsis: public void setInt(int parameterIndex, int x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a Java int value.


11.11.1.2.42. Method setLong(int, long)
setLong Methods setLong
Synopsis: public void setLong(int parameterIndex, long x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a Java long value.


11.11.1.2.43. Method setMaxFieldSize(int)
setMaxFieldSize Methods setMaxFieldSize
Synopsis: public void setMaxFieldSize(int max) throws java.sql.SQLException;
          

Parameters

max - the new max column size limit; zero means unlimited


Exceptions

SQLException

if a database-access error occurs.


The maxFieldSize limit (in bytes) is set to limit the size of data that can be returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR fields. If the limit is exceeded, the excess data is silently discarded. For maximum portability use values greater than 256.


11.11.1.2.44. Method setMaxRows(int)
setMaxRows Methods setMaxRows
Synopsis: public void setMaxRows(int max) throws java.sql.SQLException;
          

Parameters

max - the new max rows limit; zero means unlimited


Exceptions

SQLException

if a database-access error occurs.


The maxRows limit is set to limit the number of rows that any RowSet can contain. If the limit is exceeded, the excess rows are silently dropped.


11.11.1.2.45. Method setNull(int, int)
setNull Methods setNull
Synopsis: public void setNull(int parameterIndex, int sqlType) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

sqlType - SQL type code defined by java.sql.Types


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to SQL NULL.

Note: You must specify the parameter's SQL type.


11.11.1.2.46. Method setNull(int, int, String)
setNull Methods setNull
Synopsis: public void setNull(int parameterIndex, int sqlType, 
                              java.lang.String typeName) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

sqlType - a value from java.sql.Types

typeName - the fully-qualified name of an SQL user-named type, ignored if the parameter is not a user-named type or REF


Exceptions

SQLException

if a database access error occurs


Sets the designated parameter to SQL NULL. This version of setNull should be used for user-named types and REF type parameters. Examples of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.

Note: To be portable, applications must give the SQL type code and the fully-qualified SQL type name when specifying a NULL user-defined or REF parameter. In the case of a user-named type the name is the type name of the parameter itself. For a REF parameter the name is the type name of the referenced type. If a JDBC driver does not need the type code or type name information, it may ignore it. Although it is intended for user-named and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-named or REF type, the given typeName is ignored.


11.11.1.2.47. Method setObject(int, Object)
setObject Methods setObject
Synopsis: public void setObject(int parameterIndex, java.lang.Object x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - The first parameter is 1, the second is 2, ...

x - The object containing the input parameter value


Exceptions

SQLException

if a database-access error occurs.


Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

The JDBC specification specifies a standard mapping from Java Object types to SQL types. The given argument java object will be converted to the corresponding SQL type before being sent to the database.

Note that this method may be used to pass datatabase specific abstract data types, by using a Driver specific Java type. If the object is of a class implementing SQLData, the rowset should call its method writeSQL() to write it to the SQL data stream. else If the object is of a class implementing Ref, Blob, Clob, Struct, or Array then pass it to the database as a value of the corresponding SQL type. Raise an exception if there is an ambiguity, for example, if the object is of a class implementing more than one of those interfaces.


11.11.1.2.48. Method setObject(int, Object, int)
setObject Methods setObject
Synopsis: public void setObject(int parameterIndex, java.lang.Object x, 
                                int targetSqlType) 
              throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


This method is like setObject above, but the scale used is the scale of the second parameter. Scalar values have a scale of zero. Literal values have the scale present in the literal. While it is supported, it is not recommended that this method not be called with floating point input values.


11.11.1.2.49. Method setObject(int, Object, int, int)
setObject Methods setObject
Synopsis: public void setObject(int parameterIndex, java.lang.Object x, 
                                int targetSqlType, int scale) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - The first parameter is 1, the second is 2, ...

x - The object containing the input parameter value

targetSqlType - The SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.

scale - For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types this is the number of digits after the decimal. For all other types this value will be ignored,


Exceptions

SQLException

if a database-access error occurs.


Additional Information

See Also


Set the value of a parameter using an object; use the java.lang equivalent objects for integral values.

The given Java object will be converted to the targetSqlType before being sent to the database. If the object is of a class implementing SQLData, the rowset should call its method writeSQL() to write it to the SQL data stream. else If the object is of a class implementing Ref, Blob, Clob, Struct, or Array then pass it to the database as a value of the corresponding SQL type.

Note that this method may be used to pass datatabase- specific abstract data types.


11.11.1.2.50. Method setPassword(String)
setPassword Methods setPassword
Synopsis: public void setPassword(java.lang.String s) 
              throws java.sql.SQLException;
          

Parameters

password - the password string


Exceptions

SQLException

if a database-access error occurs.


Set the password.


11.11.1.2.51. Method setQueryTimeout(int)
setQueryTimeout Methods setQueryTimeout
Synopsis: public void setQueryTimeout(int seconds) 
              throws java.sql.SQLException;
          

Parameters

seconds - the new query timeout limit in seconds; zero means unlimited


Exceptions

SQLException

if a database-access error occurs.


The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute. If the limit is exceeded, a SQLException is thrown.


11.11.1.2.52. Method setReadOnly(boolean)
setReadOnly Methods setReadOnly
Synopsis: public void setReadOnly(boolean value) throws java.sql.SQLException;
          

Parameters

value - true if read-only, false otherwise


Exceptions

SQLException

if a database-access error occurs.


Set the read-onlyness of the rowset


11.11.1.2.53. Method setRef(int, Ref)
setRef Methods setRef
Synopsis: public void setRef(int parameterIndex, java.sql.Ref x) 
              throws java.sql.SQLException;
          

Parameters

i - the first parameter is 1, the second is 2, ...

x - an object representing data of an SQL REF Type


Set a REF(<structured-type>) parameter.


11.11.1.2.54. Method setShort(int, short)
setShort Methods setShort
Synopsis: public void setShort(int parameterIndex, short x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a Java short value.


11.11.1.2.55. Method setString(int, String)
setString Methods setString
Synopsis: public void setString(int parameterIndex, java.lang.String x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a Java String value.


11.11.1.2.56. Method setTime(int, Time)
setTime Methods setTime
Synopsis: public void setTime(int parameterIndex, java.sql.Time x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a java.sql.Time value.


11.11.1.2.57. Method setTime(int, Time, Calendar)
setTime Methods setTime
Synopsis: public void setTime(int parameterIndex, java.sql.Time x, 
                              java.util.Calendar cal) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a java.sql.Time value. The driver converts this to a SQL TIME value when it sends it to the database.


11.11.1.2.58. Method setTimestamp(int, Timestamp)
setTimestamp Methods setTimestamp
Synopsis: public void setTimestamp(int parameterIndex, java.sql.Timestamp x) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a java.sql.Timestamp value.


11.11.1.2.59. Method setTimestamp(int, Timestamp, Calendar)
setTimestamp Methods setTimestamp
Synopsis: public void setTimestamp(int parameterIndex, java.sql.Timestamp x, 
                                   java.util.Calendar cal) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the parameter value


Exceptions

SQLException

if a database-access error occurs.


Set a parameter to a java.sql.Timestamp value. The driver converts this to a SQL TIMESTAMP value when it sends it to the database.


11.11.1.2.60. Method setTransactionIsolation(int)
setTransactionIsolation Methods setTransactionIsolation
Synopsis: public void setTransactionIsolation(int value) 
              throws java.sql.SQLException;
          

Parameters

level - the transaction isolation level


Exceptions

SQLException

if a database-access error occurs.


Set the transaction isolation.


11.11.1.2.61. Method setType(int)
setType Methods setType
Synopsis: public void setType(int value) throws java.sql.SQLException;
          

Parameters

value - may be TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, or TYPE_SCROLL_SENSITIVE


Exceptions

SQLException

if a database-access error occurs


Set the type of this result set.


11.11.1.2.62. Method setTypeMap(Map)
setTypeMap Methods setTypeMap
Synopsis: public void setTypeMap(java.util.Map value) 
              throws java.sql.SQLException;
          

Parameters

map - a map object


Exceptions

SQLException

if a database-access error occurs.


Install a type-map object as the default type-map for this rowset.


11.11.1.2.63. Method setUnicodeStream(int, InputStream, int)
setUnicodeStream Methods setUnicodeStream
Synopsis: public void setUnicodeStream(int parameterIndex, 
                                       java.io.InputStream x, int length) 
              throws java.sql.SQLException;
          

Parameters

parameterIndex - the first parameter is 1, the second is 2, ...

x - the java input stream which contains the UNICODE parameter value

length - the number of bytes in the stream


Exceptions

SQLException

if a database-access error occurs.


Deprecated

When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.


11.11.1.2.64. Method setUrl(String)
setUrl Methods setUrl
Synopsis: public void setUrl(java.lang.String s) throws java.sql.SQLException;
          

Parameters

url - a string value, may be null


Exceptions

SQLException

if a database-access error occurs.


Set the url used to create a connection. Setting this property is optional. If a url is used, a JDBC driver that accepts the url must be loaded by the application before the rowset is used to connect to a database. The rowset will use the url internally to create a database connection when reading or writing data. Either a url or a data source name is used to create a connection, whichever was specified most recently.


11.11.1.2.65. Method setUsername(String)
setUsername Methods setUsername
Synopsis: public void setUsername(java.lang.String s) 
              throws java.sql.SQLException;
          

Parameters

name - a user name


Exceptions

SQLException

if a database-access error occurs.


Set the user name.




11.11.2. Class OPLCachedRowSet

OPLCachedRowSet Classes OPLCachedRowSet

A OPLCachedRowSet is a disconnected, serializable, scrollable container for tabular data. A primary purpose of the OPLCachedRowSet class is to provide a representation of a JDBC ResultSet that can be passed between different components of a remote application. For example, a OPLCachedRowSet can be used to send the result of a query executed by an Enterprise JavaBeans component running in a server environment over a network to a client running in a web browser. A second use for OPLCachedRowSets is to provide scrolling and updating for ResultSets that don't provide these capabilities themselves. A OPLCachedRowSet can be used to augment the capabilities of a JDBC driver that doesn't have full support for scrolling and updating. Finally, a OPLCachedRowSet can be used to provide Java applications with access to tabular data in an environment such as a thin client or PDA, where it would be inappropriate to use a JDBC driver due to resource limitations or security considerations. The OPLCachedRowSet class provides a means to "get rows in" and "get changed rows out" without the need to implement the full JDBC API.

A OPLCachedRowSet object can contain data retrieved via a JDBC driver or data from some other source, such as a spreadsheet. Both a OPLCachedRowSet object and its metadata can be created from scratch. A component that acts as a factory for rowsets can use this capability to create a rowset containing data from non-JDBC data sources.

The term 'disconnected' implies that a OPLCachedRowSet only makes use of a JDBC connection briefly while data is being read from the database and used to populate it with rows, and again while updated rows are being propagated back to the underlying database. During the remainder of its lifetime, a OPLCachedRowSet object isn't associated with an underlying database connection. A OPLCachedRowSet object can simply be thought of as a disconnected set of rows that are being cached outside of a data source. Since all data is cached in memory, OPLCachedRowSets are not appropriate for extremely large data sets.

The contents of a OPLCachedRowSet may be updated and the updates can be propagated to an underlying data source. OPLCachedRowSets support an optimistic concurrency control mechanism - no locks are maintained in the underlying database during disconnected use of the rowset. Both the original value and current value of the OPLCachedRowSet are maintained for use by the optimistic routines.

11.11.2.1. Synopsis

public class OPLCachedRowSet extends BaseRowSet implements RowSetInternal,Serializable,Cloneable {
  // Public Constructors
  public OPLCachedRowSet() throws java.sql.SQLException;
  // Public Methods
  public void finalize() throws java.lang.Throwable;
  public void setCommand(java.lang.String cmd) throws java.sql.SQLException;
  public void setConcurrency(int concurrency) throws java.sql.SQLException;
  public void acceptChanges() throws java.sql.SQLException;
  public void acceptChanges(java.sql.Connection _conn) 
      throws java.sql.SQLException;
  public void execute() throws java.sql.SQLException;
  public void execute(java.sql.Connection _conn) throws java.sql.SQLException;
  public void populate(java.sql.ResultSet rs) throws java.sql.SQLException;
  public void setShowDeleted(boolean value) throws java.sql.SQLException;
  public boolean getShowDeleted() throws java.sql.SQLException;
  public String getTableName() throws java.sql.SQLException;
  public void setTableName(java.lang.String _tableName) 
      throws java.sql.SQLException;
  public int[] getKeyCols() throws java.sql.SQLException;
  public void setKeyColumns(int[] keys) throws java.sql.SQLException;
  public void cancelRowDelete() throws java.sql.SQLException;
  public void cancelRowInsert() throws java.sql.SQLException;
  public void cancelRowUpdates() throws java.sql.SQLException;
  public boolean columnUpdated(int columnIndex) throws java.sql.SQLException;
  public void setOriginal() throws java.sql.SQLException;
  public void setOriginalRow() throws java.sql.SQLException;
  public void restoreOriginal() throws java.sql.SQLException;
  public int size();
  public Collection toCollection() throws java.sql.SQLException;
  public Collection toCollection(int col) throws java.sql.SQLException;
  public void release() throws java.sql.SQLException;
  public RowSet createCopy() throws java.sql.SQLException;
  public RowSet createShared() throws java.sql.SQLException;
  public void setMetaData(javax.sql.RowSetMetaData md) 
      throws java.sql.SQLException;
  public Connection getConnection() throws java.sql.SQLException;
  public ResultSet getOriginal() throws java.sql.SQLException;
  public ResultSet getOriginalRow() throws java.sql.SQLException;
  public void close() throws java.sql.SQLException;
  public boolean next() throws java.sql.SQLException;
  public boolean previous() throws java.sql.SQLException;
  public boolean first() throws java.sql.SQLException;
  public boolean last() throws java.sql.SQLException;
  public boolean absolute(int row) throws java.sql.SQLException;
  public boolean relative(int rows) throws java.sql.SQLException;
  public void beforeFirst() throws java.sql.SQLException;
  public void afterLast() throws java.sql.SQLException;
  public boolean isBeforeFirst() throws java.sql.SQLException;
  public boolean isAfterLast() throws java.sql.SQLException;
  public boolean isFirst() throws java.sql.SQLException;
  public boolean isLast() throws java.sql.SQLException;
  public int getRow() throws java.sql.SQLException;
  public boolean rowUpdated() throws java.sql.SQLException;
  public boolean rowInserted() throws java.sql.SQLException;
  public boolean rowDeleted() throws java.sql.SQLException;
  public void refreshRow() throws java.sql.SQLException;
  public void insertRow() throws java.sql.SQLException;
  public void updateRow() throws java.sql.SQLException;
  public void deleteRow() throws java.sql.SQLException;
  public void moveToInsertRow() throws java.sql.SQLException;
  public void moveToCurrentRow() throws java.sql.SQLException;
  public boolean wasNull() throws java.sql.SQLException;
  public SQLWarning getWarnings() throws java.sql.SQLException;
  public void clearWarnings() throws java.sql.SQLException;
  public String getCursorName() throws java.sql.SQLException;
  public ResultSetMetaData getMetaData() throws java.sql.SQLException;
  public int findColumn(java.lang.String columnName) 
      throws java.sql.SQLException;
  public String getString(int columnIndex) throws java.sql.SQLException;
  public boolean getBoolean(int columnIndex) throws java.sql.SQLException;
  public byte getByte(int columnIndex) throws java.sql.SQLException;
  public short getShort(int columnIndex) throws java.sql.SQLException;
  public int getInt(int columnIndex) throws java.sql.SQLException;
  public long getLong(int columnIndex) throws java.sql.SQLException;
  public float getFloat(int columnIndex) throws java.sql.SQLException;
  public double getDouble(int columnIndex) throws java.sql.SQLException;
  public BigDecimal getBigDecimal(int columnIndex) 
      throws java.sql.SQLException;
  public BigDecimal getBigDecimal(int columnIndex, int scale) 
      throws java.sql.SQLException;
  public byte[] getBytes(int columnIndex) throws java.sql.SQLException;
  public Date getDate(int columnIndex) throws java.sql.SQLException;
  public Time getTime(int columnIndex) throws java.sql.SQLException;
  public Timestamp getTimestamp(int columnIndex) throws java.sql.SQLException;
  public InputStream getAsciiStream(int columnIndex) 
      throws java.sql.SQLException;
  public InputStream getUnicodeStream(int columnIndex) 
      throws java.sql.SQLException;
  public InputStream getBinaryStream(int columnIndex) 
      throws java.sql.SQLException;
  public Object getObject(int columnIndex) throws java.sql.SQLException;
  public String getString(java.lang.String columnName) 
      throws java.sql.SQLException;
  public boolean getBoolean(java.lang.String columnName) 
      throws java.sql.SQLException;
  public byte getByte(java.lang.String columnName) 
      throws java.sql.SQLException;
  public short getShort(java.lang.String columnName) 
      throws java.sql.SQLException;
  public int getInt(java.lang.String columnName) throws java.sql.SQLException;
  public long getLong(java.lang.String columnName) 
      throws java.sql.SQLException;
  public float getFloat(java.lang.String columnName) 
      throws java.sql.SQLException;
  public double getDouble(java.lang.String columnName) 
      throws java.sql.SQLException;
  public BigDecimal getBigDecimal(java.lang.String columnName, int scale) 
      throws java.sql.SQLException;
  public byte[] getBytes(java.lang.String columnName) 
      throws java.sql.SQLException;
  public Date getDate(java.lang.String columnName) 
      throws java.sql.SQLException;
  public Time getTime(java.lang.String columnName) 
      throws java.sql.SQLException;
  public Timestamp getTimestamp(java.lang.String columnName) 
      throws java.sql.SQLException;
  public InputStream getAsciiStream(java.lang.String columnName) 
      throws java.sql.SQLException;
  public InputStream getUnicodeStream(java.lang.String columnName) 
      throws java.sql.SQLException;
  public InputStream getBinaryStream(java.lang.String columnName) 
      throws java.sql.SQLException;
  public Object getObject(java.lang.String columnName) 
      throws java.sql.SQLException;
  public Reader getCharacterStream(int columnIndex) 
      throws java.sql.SQLException;
  public Reader getCharacterStream(java.lang.String columnName) 
      throws java.sql.SQLException;
  public BigDecimal getBigDecimal(java.lang.String columnName) 
      throws java.sql.SQLException;
  public void updateNull(int columnIndex) throws java.sql.SQLException;
  public void updateBoolean(int columnIndex, boolean x) 
      throws java.sql.SQLException;
  public void updateByte(int columnIndex, byte x) throws java.sql.SQLException;
  public void updateShort(int columnIndex, short x) 
      throws java.sql.SQLException;
  public void updateInt(int columnIndex, int x) throws java.sql.SQLException;
  public void updateLong(int columnIndex, long x) throws java.sql.SQLException;
  public void updateFloat(int columnIndex, float x) 
      throws java.sql.SQLException;
  public void updateDouble(int columnIndex, double x) 
      throws java.sql.SQLException;
  public void updateBigDecimal(int columnIndex, java.math.BigDecimal x) 
      throws java.sql.SQLException;
  public void updateString(int columnIndex, java.lang.String x) 
      throws java.sql.SQLException;
  public void updateBytes(int columnIndex, byte[] x) 
      throws java.sql.SQLException;
  public void updateDate(int columnIndex, java.sql.Date x) 
      throws java.sql.SQLException;
  public void updateTime(int columnIndex, java.sql.Time x) 
      throws java.sql.SQLException;
  public void updateTimestamp(int columnIndex, java.sql.Timestamp x) 
      throws java.sql.SQLException;
  public void updateAsciiStream(int columnIndex, java.io.InputStream x, 
                                int length) throws java.sql.SQLException;
  public void updateBinaryStream(int columnIndex, java.io.InputStream x, 
                                 int length) throws java.sql.SQLException;
  public void updateCharacterStream(int columnIndex, java.io.Reader x, 
                                    int length) throws java.sql.SQLException;
  public void updateObject(int columnIndex, java.lang.Object x, int scale) 
      throws java.sql.SQLException;
  public void updateObject(int columnIndex, java.lang.Object x) 
      throws java.sql.SQLException;
  public void updateNull(java.lang.String columnName) 
      throws java.sql.SQLException;
  public void updateBoolean(java.lang.String columnName, boolean x) 
      throws java.sql.SQLException;
  public void updateByte(java.lang.String columnName, byte x) 
      throws java.sql.SQLException;
  public void updateShort(java.lang.String columnName, short x) 
      throws java.sql.SQLException;
  public void updateInt(java.lang.String columnName, int x) 
      throws java.sql.SQLException;
  public void updateLong(java.lang.String columnName, long x) 
      throws java.sql.SQLException;
  public void updateFloat(java.lang.String columnName, float x) 
      throws java.sql.SQLException;
  public void updateDouble(java.lang.String columnName, double x) 
      throws java.sql.SQLException;
  public void updateBigDecimal(java.lang.String columnName, 
                               java.math.BigDecimal x) 
      throws java.sql.SQLException;
  public void updateString(java.lang.String columnName, java.lang.String x) 
      throws java.sql.SQLException;
  public void updateBytes(java.lang.String columnName, byte[] x) 
      throws java.sql.SQLException;
  public void updateDate(java.lang.String columnName, java.sql.Date x) 
      throws java.sql.SQLException;
  public void updateTime(java.lang.String columnName, java.sql.Time x) 
      throws java.sql.SQLException;
  public void updateTimestamp(java.lang.String columnName, 
                              java.sql.Timestamp x) 
      throws java.sql.SQLException;
  public void updateAsciiStream(java.lang.String columnName, 
                                java.io.InputStream x, int length) 
      throws java.sql.SQLException;
  public void updateBinaryStream(java.lang.String columnName, 
                                 java.io.InputStream x, int length) 
      throws java.sql.SQLException;
  public void updateCharacterStream(java.lang.String columnName, 
                                    java.io.Reader reader, int length) 
      throws java.sql.SQLException;
  public void updateObject(java.lang.String columnName, java.lang.Object x, 
                           int scale) throws java.sql.SQLException;
  public void updateObject(java.lang.String columnName, java.lang.Object x) 
      throws java.sql.SQLException;
  public Statement getStatement() throws java.sql.SQLException;
  public Object getObject(int colIndex, java.util.Map map) 
      throws java.sql.SQLException;
  public Ref getRef(int colIndex) throws java.sql.SQLException;
  public Blob getBlob(int colIndex) throws java.sql.SQLException;
  public Clob getClob(int colIndex) throws java.sql.SQLException;
  public Array getArray(int colIndex) throws java.sql.SQLException;
  public Object getObject(java.lang.String colName, java.util.Map map) 
      throws java.sql.SQLException;
  public Ref getRef(java.lang.String colName) throws java.sql.SQLException;
  public Blob getBlob(java.lang.String colName) throws java.sql.SQLException;
  public Clob getClob(java.lang.String colName) throws java.sql.SQLException;
  public Array getArray(java.lang.String colName) throws java.sql.SQLException;
  public Date getDate(int columnIndex, java.util.Calendar cal) 
      throws java.sql.SQLException;
  public Date getDate(java.lang.String columnName, java.util.Calendar cal) 
      throws java.sql.SQLException;
  public Time getTime(int columnIndex, java.util.Calendar cal) 
      throws java.sql.SQLException;
  public Time getTime(java.lang.String columnName, java.util.Calendar cal) 
      throws java.sql.SQLException;
  public Timestamp getTimestamp(int columnIndex, java.util.Calendar cal) 
      throws java.sql.SQLException;
  public Timestamp getTimestamp(java.lang.String columnName, 
                                java.util.Calendar cal) 
      throws java.sql.SQLException;
  public URL getURL(int columnIndex) throws java.sql.SQLException;
  public URL getURL(java.lang.String columnName) throws java.sql.SQLException;
  public void updateRef(int columnIndex, java.sql.Ref x) 
      throws java.sql.SQLException;
  public void updateRef(java.lang.String columnName, java.sql.Ref x) 
      throws java.sql.SQLException;
  public void updateBlob(int columnIndex, java.sql.Blob x) 
      throws java.sql.SQLException;
  public void updateBlob(java.lang.String columnName, java.sql.Blob x) 
      throws java.sql.SQLException;
  public void updateClob(int columnIndex, java.sql.Clob x) 
      throws java.sql.SQLException;
  public void updateClob(java.lang.String columnName, java.sql.Clob x) 
      throws java.sql.SQLException;
  public void updateArray(int columnIndex, java.sql.Array x) 
      throws java.sql.SQLException;
  public void updateArray(java.lang.String columnName, java.sql.Array x) 
      throws java.sql.SQLException;
}
      

Inheritance Path

java.lang.Object

|

openlink.javax.BaseRowSet

|

openlink.javax.OPLCachedRowSet


11.11.2.2. Members

11.11.2.2.1. Constructor OPLCachedRowSet()
OPLCachedRowSet Methods OPLCachedRowSet
Synopsis: public OPLCachedRowSet() throws java.sql.SQLException;
          

Exceptions

SQLException

if an error occurs.


Create a OPLCachedRowSet object. The object has no metadata.


11.11.2.2.2. Method absolute(int)
absolute Methods absolute
Synopsis: public boolean absolute(int row) throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs, or row is 0, or rowset type is TYPE_FORWARD_ONLY.


Move to an absolute row number in the rowset. It notifies listeners that the cursor has moved.

If row is positive, moves to an absolute row with respect to the beginning of the rowset. The first row is row 1, the second is row 2, etc.

If row is negative, moves to an absolute row position with respect to the end of rowset. For example, calling absolute(-1) positions the cursor on the last row, absolute(-2) indicates the next-to-last row, etc.

An attempt to position the cursor beyond the first/last row in the rowset, leaves the cursor before/after the first/last row, respectively.

Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().


11.11.2.2.3. Method acceptChanges()
acceptChanges Methods acceptChanges
Synopsis: public void acceptChanges() throws java.sql.SQLException;
          

Exceptions

SQLException

if an error occurs.


Propagate all row update, insert, and delete changes to a data source. An SQLException is thrown if any of the updates cannot be propagated. If acceptChanges() fails then the caller can assume that none of the updates are reflected in the data source. The current row is set to the first "updated" row that resulted in an exception, in the case that an exception is thrown. With one exception, if the row that caused the exception is a "deleted" row, then in the usual case, when deleted rows are not shown, the current row isn't affected. When successful, calling acceptChanges() replaces the original value of the rowset with the current value. Note: Both the original and current value of the rowset are maintained. The original state is the value of the rowset following its creation (i.e. empty), or following the last call to acceptChanges(), execute(), populate(), release(), or restoreOriginal(). Internally, a RowSetWriter component is envoked to write the data for each row.


11.11.2.2.4. Method acceptChanges(Connection)
acceptChanges Methods acceptChanges
Synopsis: public void acceptChanges(java.sql.Connection _conn) 
              throws java.sql.SQLException;
          

Parameters

_conn - a database connection


Exceptions

SQLException

if an error occurs.


Like acceptChanges() above, but takes a Connection argument. The Connection is used internally when doing the updates. This form isn't used unless the underlying data source is a JDBC data source.


11.11.2.2.5. Method afterLast()
afterLast Methods afterLast
Synopsis: public void afterLast() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs, or rowset type is TYPE_FORWARD_ONLY.


Moves to the end of the rowset, just after the last row. Has no effect if the rowset contains no rows. It notifies listeners that the cursor has moved.


11.11.2.2.6. Method beforeFirst()
beforeFirst Methods beforeFirst
Synopsis: public void beforeFirst() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs, or rowset type is TYPE_FORWARD_ONLY


Moves to the front of the rowset, just before the first row. Has no effect if the rowset contains no rows. It notifies listeners that the cursor has moved.


11.11.2.2.7. Method cancelRowDelete()
cancelRowDelete Methods cancelRowDelete
Synopsis: public void cancelRowDelete() throws java.sql.SQLException;
          

Exceptions

SQLException

if an error occurs.


Cancels deletion of the current row and notifies listeners that a row has changed. After calling cancelRowDelete() the current row is no longer marked for deletion. An exception is thrown if there is no current row. Note: This method can be ignored if deleted rows aren't being shown (the normal case).


11.11.2.2.8. Method cancelRowInsert()
cancelRowInsert Methods cancelRowInsert
Synopsis: public void cancelRowInsert() throws java.sql.SQLException;
          

Exceptions

SQLException

if an error occurs.


Cancels insertion of the current row and notifies listeners that a row has changed. An exception is thrown if the row isn't an inserted row. The current row is immediately removed from the rowset. This operation cannot be undone.


11.11.2.2.9. Method cancelRowUpdates()
cancelRowUpdates Methods cancelRowUpdates
Synopsis: public void cancelRowUpdates() throws java.sql.SQLException;
          

Exceptions

SQLException

if an error occurs.


The cancelRowUpdates() method may be called after calling an updateXXX() method(s) and before calling updateRow() to rollback the updates made to a row. If no updates have been made or updateRow() has already been called, then this method has no effect. It notifies listeners that a row has changed, if it has effect.


11.11.2.2.10. Method clearWarnings()
clearWarnings Methods clearWarnings
Synopsis: public void clearWarnings() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs.


After this call getWarnings returns null until a new warning is reported for this ResultSet.


11.11.2.2.11. Method close()
close Methods close
Synopsis: public void close() throws java.sql.SQLException;
          

Exceptions

SQLException

if an error occurs.


Releases the current contents of this rowset, discarding outstanding updates. The rowset contains no rows after the method release is called. This method sends a RowSetChangedEvent object to all registered listeners prior to returning.


11.11.2.2.12. Method columnUpdated(int)
columnUpdated Methods columnUpdated
Synopsis: public boolean columnUpdated(int columnIndex) 
              throws java.sql.SQLException;
          

Parameters

columnIndex - the first column is 1, the second is 2, ...

return - true if the column has been updated


Exceptions

SQLException

if a database-access error occurs


Determine if the column from the current row has been updated.


11.11.2.2.13. Method createCopy()
createCopy Methods createCopy
Synopsis: public RowSet createCopy() throws java.sql.SQLException;
          

Exceptions

SQLException

if an error occurs.


Creates a RowSet object that is a deep copy of this OPLCachedRowSet object's data. Updates made on a copy are not visible to the original rowset; a copy of a rowset is completely independent from the original. Making a copy saves the cost of creating an identical rowset from first principles, which can be quite expensive. For example, it doesn't do the query to a remote database server.


11.11.2.2.14. Method createShared()
createShared Methods createShared
Synopsis: public RowSet createShared() throws java.sql.SQLException;
          

Exceptions

SQLException

if an error occurs.


Returns a new rowset object backed by the same data. Updates made by a shared duplicate are visible to the original rowset and other duplicates. A rowset and its duplicates form a set of cursors that iterate over a shared set of rows, providing different views of the underlying data. Duplicates also share property values. So, for example, if a rowset is read-only then all of its duplicates will be read-only.


11.11.2.2.15. Method deleteRow()
deleteRow Methods deleteRow
Synopsis: public void deleteRow() throws java.sql.SQLException;
          

Exceptions

SQLException

if a database-access error occurs, or if called when on the insert row.


Delete the current row from this OPLCachedRowSet object and it notifies listeners that a row has changed. Cannot be called when the cursor is on the insert row. The method marks the current row as deleted, but it does not delete the row from the underlying data source. The method acceptChanges must be called to delete the row in the data source.


11.11.2.2.16. Method execute()
execute Methods execute
Synopsis: public void execute() throws java.sql.SQLException;
          

Exceptions

SQLException

if an error occurs.