Sunday, July 3, 2011

Using the Default Constructor

The first statement in the following code excerpt creates an empty JdbcRowSet object.

public void createJdbcRowSet(String username, String password) {       jdbcRs = new JdbcRowSetImpl();       jdbcRs.setCommand("select * from COFFEES");       jdbcRs.setUrl("jdbc:myDriver:myAttribute");       jdbcRs.setUsername(username);       jdbcRs.setPassword(password);       jdbcRs.execute();       // ... 

The object jdbcRs contains no data until you specify a SQL statement with the method setCommand, specify how the JdbcResultSet object connects the database, and then run the method execute.

All of the reference implementation constructors assign the default values for the properties listed in the section Default JdbcRowSet Objects.

No comments:

Post a Comment