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

PreparedStatementWrapper30

public class PreparedStatementWrapper30 extends com.sun.gjc.spi.base.PreparedStatementWrapper
Wrapper for JDBC 3.0 PreparedStatement

Fields Summary
Constructors Summary
public PreparedStatementWrapper30(Connection con, PreparedStatement statement)
Creates a new instance of PreparedStatement Wrapper for JDBC 3.0

param
con ConnectionWrapper
param
statement PreparedStatement that is wrapped

        super(con, statement);
    
Methods Summary
public java.sql.ResultSetexecuteQuery()
Executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query.

return
a ResultSet object that contains the data produced by the query; never null
throws
java.sql.SQLException if a database access error occurs or the SQL statement does not return a ResultSet object

        ResultSet rs = preparedStatement.executeQuery();
        if (rs == null)
            return null;
        return new ResultSetWrapper30(this, rs);
    
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
java.sql.SQLException if a database access error occurs or the given SQL statement produces anything other than a single ResultSet object

        ResultSet rs = preparedStatement.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
java.sql.SQLException if a database access error occurs
since
1.4

        ResultSet rs = preparedStatement.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
java.sql.SQLException if a database access error occurs
see
#execute

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