Programmer Guide : solidDB® JDBC Driver : JDBC 2.0 optional package API support : solidDB® Connected RowSet Class: SolidJDBCRowSet
  
solidDB® Connected RowSet Class: SolidJDBCRowSet
The RowSet described in this topic, extends solid.jdbc.SolidBaseRowSet (which implements javax.sql.RowSet) constructors.
/**
 * Create a SolidJDBCRowSet with an existing Connection handle */
public SolidJDBCRowSet(java.sql.Connection conn)
/**
* Create a SolidJDBCRowSet with an existing ResultSet handle */
public SolidJDBCRowSet(java.sql.ResultSet rset)
/**
 * Create a new SolidJDBCRowSet with given url, username and
 * password.
 */
public SolidJDBCRowSet(String url, String uname, String pwd)
/**
  Create a new SolidJDBCRowSet with given url, username,
  password and JNDI naming context.
*/
public SolidJDBCRowSet(String dsname,
                       String username,
                       String password,
                       Context namingcontext)
For examples, see the method interface description in the Java 2 Platform, Standard Edition, v 1.4.2 API Specification at java.sun.com.
Considerations about the usage of SolidJDBCRowSet
There are certain methods that you can call (usually for setting parameters for commands to be executed or setting the properties of the RowSet instance) before a connection to the database has been made. However, most of the RowSet interface methods can be called only after a connection to the database has been made. This means that method a command has been set with method setCommand(String) and method execute() has been called. If the SolidJDBCRowSet instance has no previous java.sql.Connection handle, the connection will be established during execute() call. After the execute() call, the row set instance contains a java.sql.Connection object, a java.sql.PreparedStatement object, and if the command execute was a query statement, it contains also a java.sql.ResultSet handle. It also contains all parameter setting methods: setString, setObject, and so on.
The following example describes the proper use of SolidJDBCRowSet class.
/**
* A simple example on how to use SolidJDBCRowSet
* First: create an instance of a connected RowSet class.
* You can give the url, username and password
* right away in the constructor below, but null parameters
* for the corresponding values have bee given in the example
* just to show how to use setUrl, setUsername (and so on) methods
* of the RowSet class.
*/
SolidJDBCRowSet rs = new SolidJDBCRowSet(null, null, null);
// Set the url for the connection
rs.setUrl("jdbc:solid://localhost:1313");
// set the username rs.setUsername("user1");
// set the passwd rs.setPassword("pwd1");
/**
* Note! You can set command parameters and other properties
* in any order you like, for example, you can set the parameters
* before you have defined the command to be executed. You can
* also define the command parameters in any order, since the
* command statement as well as the given parameters will not be
* parsed until a connection to the database has been made in
* the execute() method call.
*/
// set parameter #2 for the command
rs.setString(2,"'SYS_SYNC%'");
// set the command string
rs.setCommand("select table_name from tables
  where table_name like ?
        and table_name not like ?;");
// set the parameter #1 rs.setString(1,"'SYS_%'");
// execute the command. The connection to the database is not
// established before this call.
rs.execute();
// now you can browse the ResultSet
while( rowset.next() ){
  // do stuff
}
// close the result set. This method call closes the connection
// to the database as well.
rs.close()
See also
JDBC 2.0 optional package API support