FileDocCategorySizeDatePackage
StatementWrapper30.javaAPI DocGlassfish v2 API4682Fri May 04 22:36:06 BST 2007com.sun.gjc.spi.jdbc30

StatementWrapper30

public class StatementWrapper30 extends com.sun.gjc.spi.base.StatementWrapper
Wrapper for JDBC 3.0 Statement

Fields Summary
Constructors Summary
public StatementWrapper30(Connection con, Statement statement)
Creates a new instance of StatementWrapper for JDBC 3.0

param
con ConnectionWrapper
param
statement Statement that is to be wrapped

        super(con, statement);
    
Methods Summary
public java.sql.ResultSetexecuteQuery(java.lang.String sql)
Executes the given SQL statement, which returns a single ResultSet object.

param
sql an SQL statement to be sent to the database, typically a static SQL SELECT statement
return
a ResultSet object that contains the data produced by the given query; never null
exception
SQLException if a database access error occurs or the given SQL statement produces anything other than a single ResultSet object

        ResultSet rs = jdbcStatement.executeQuery(sql);
        if (rs == null)
            return null;
        return new ResultSetWrapper30(this, rs);
    
public java.sql.ResultSetgetGeneratedKeys()
Retrieves any auto-generated keys created as a result of executing this Statement object. If this Statement object did not generate any keys, an empty ResultSet object is returned.

return
a ResultSet object containing the auto-generated key(s) generated by the execution of this Statement object
exception
SQLException if a database access error occurs
since
1.4

        ResultSet rs = jdbcStatement.getGeneratedKeys();
        if (rs == null)
            return null;
        return new ResultSetWrapper30(this, rs);
    
public java.sql.ResultSetgetResultSet()
Retrieves the current result as a ResultSet object. This method should be called only once per result.

return
the current result as a ResultSet object or null if the result is an update count or there are no more results
exception
SQLException if a database access error occurs
see
#execute

        ResultSet rs = jdbcStatement.getResultSet();
        if (rs == null)
            return null;
        return new ResultSetWrapper30(this, rs);