API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.sql. Statement View Source
Author(s)
Since
Version
Serial
Hierarchy
 Wrapper
      Statement
Subinterfaces
Description
public interface Statement
  The object used for executing a static SQL statement and returning the results it produces.
Methods
Hide/Show inherited methods
public void addBatch (String sql) throws SQLException
  Adds the given SQL command to the current list of commmands for this Statement object.
public void cancel () throws SQLException
  Cancels this Statement object if both the DBMS and driver support aborting an SQL statement.
public void clearBatch () throws SQLException
  Empties this Statement object's current list of SQL commands.
public void clearWarnings () throws SQLException
  Clears all the warnings reported on this Statement object.
public void close () throws SQLException
  Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.
public boolean execute (String sql) throws SQLException
  Executes the given SQL statement, which may return multiple results.
public boolean execute (String sql, int autoGeneratedKeys) throws SQLException
  Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval.
public boolean execute (String sql, int[] columnIndexes) throws SQLException
  Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.
public boolean execute (String sql, String columnNames) throws SQLException
  Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.
public int executeBatch () throws SQLException
  Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.
public ResultSet executeQuery (String sql) throws SQLException
  Executes the given SQL statement, which returns a single ResultSet object.
public int executeUpdate (String sql) throws SQLException
  Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.
public int executeUpdate (String sql, int autoGeneratedKeys) throws SQLException
  Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval.
public int executeUpdate (String sql, int[] columnIndexes) throws SQLException
  Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.
public int executeUpdate (String sql, String columnNames) throws SQLException
  Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval.
public Connection getConnection () throws SQLException
  Retrieves the Connection object that produced this Statement object.
public int getFetchDirection () throws SQLException
  Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object.
public int getFetchSize () throws SQLException
  Retrieves the number of result set rows that is the default fetch size for ResultSet objects generated from this Statement object.
public ResultSet getGeneratedKeys () throws SQLException
  Retrieves any auto-generated keys created as a result of executing this Statement object.
public int getMaxFieldSize () throws SQLException
  Retrieves the maximum number of bytes that can be returned for character and binary column values in a ResultSet object produced by this Statement object.
public int getMaxRows () throws SQLException
  Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain.
public boolean getMoreResults () throws SQLException
  Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) obtained with the method getResultSet.
public boolean getMoreResults (int current) throws SQLException
  Moves to this Statement object's next result, deals with any current ResultSet object(s) according to the instructions specified by the given flag, and returns true if the next result is a ResultSet object.
public int getQueryTimeout () throws SQLException
  Retrieves the number of seconds the driver will wait for a Statement object to execute.
public ResultSet getResultSet () throws SQLException
  Retrieves the current result as a ResultSet object.
public int getResultSetConcurrency () throws SQLException
  Retrieves the result set concurrency for ResultSet objects generated by this Statement object.
public int getResultSetHoldability () throws SQLException
  Retrieves the result set holdability for ResultSet objects generated by this Statement object.
public int getResultSetType () throws SQLException
  Retrieves the result set type for ResultSet objects generated by this Statement object.
public int getUpdateCount () throws SQLException
  Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned.
public SQLWarning getWarnings () throws SQLException
  Retrieves the first warning reported by calls on this Statement object.
public boolean isClosed () throws SQLException
  Retrieves whether this Statement object has been closed.
public boolean isPoolable () throws SQLException
  Returns a value indicating whether the Statement is poolable or not.
public void setCursorName (String name) throws SQLException
  Sets the SQL cursor name to the given String, which will be used by subsequent Statement object execute methods.
public void setEscapeProcessing (boolean enable) throws SQLException
  Sets escape processing on or off.
public void setFetchDirection (int direction) throws SQLException
  Gives the driver a hint as to the direction in which rows will be processed in ResultSet objects created using this Statement object.
public void setFetchSize (int rows) throws SQLException
  Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed for ResultSet objects genrated by this Statement.
public void setMaxFieldSize (int max) throws SQLException
  Sets the limit for the maximum number of bytes that can be returned for character and binary column values in a ResultSet object produced by this Statement object.
public void setMaxRows (int max) throws SQLException
  Sets the limit for the maximum number of rows that any ResultSet object generated by this Statement object can contain to the given number.
public void setPoolable (boolean poolable) throws SQLException
  Requests that a Statement be pooled or not pooled.
public void setQueryTimeout (int seconds) throws SQLException
  Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.
Fields
Hide/Show inherited fields
publicfinalstatic int CLOSE_ALL_RESULTS = "3"
  The constant indicating that all ResultSet objects that have previously been kept open should be closed when calling getMoreResults.
publicfinalstatic int CLOSE_CURRENT_RESULT = "1"
  The constant indicating that the current ResultSet object should be closed when calling getMoreResults.
publicfinalstatic int EXECUTE_FAILED = "-3"
  The constant indicating that an error occured while executing a batch statement.
publicfinalstatic int KEEP_CURRENT_RESULT = "2"
  The constant indicating that the current ResultSet object should not be closed when calling getMoreResults.
publicfinalstatic int NO_GENERATED_KEYS = "2"
  The constant indicating that generated keys should not be made available for retrieval.
publicfinalstatic int RETURN_GENERATED_KEYS = "1"
  The constant indicating that generated keys should be made available for retrieval.
publicfinalstatic int SUCCESS_NO_INFO = "-2"
  The constant indicating that a batch statement executed successfully but that no count of the number of rows it affected is available.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar