All Superinterfaces:
AutoCloseable, Statement, Wrapper
All Known Subinterfaces:
CallableStatement

  • Field Summary

    Fields declared in interface Statement

    CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO

    static final int

    The constant indicating that all ResultSet objects that have previously been kept open should be closed when calling getMoreResults.

    static final int

    The constant indicating that the current ResultSet object should be closed when calling getMoreResults.

    static final int

    The constant indicating that an error occurred while executing a batch statement.

    static final int

    The constant indicating that the current ResultSet object should not be closed when calling getMoreResults.

    static final int

    The constant indicating that generated keys should not be made available for retrieval.

    static final int

    The constant indicating that generated keys should be made available for retrieval.

    static final int

    The constant indicating that a batch statement executed successfully but that no count of the number of rows it affected is available.

  • Method Summary

    void

    addBatch()

    Adds a set of parameters to this PreparedStatement object's batch of commands.

    void

    Clears the current parameter values immediately.

    boolean

    execute()

    Executes the SQL statement in this PreparedStatement object, which may be any kind of SQL statement.

    default long

    Executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

    Executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query.

    int

    Executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

    Retrieves a ResultSetMetaData object that contains information about the columns of the ResultSet object that will be returned when this PreparedStatement object is executed.

    Retrieves the number, types and properties of this PreparedStatement object's parameters.

    void

    setArray(int parameterIndex, Array x)

    Sets the designated parameter to the given java.sql.Array object.

    void

    Sets the designated parameter to the given input stream.

    void

    setAsciiStream(int parameterIndex, InputStream x, int length)

    Sets the designated parameter to the given input stream, which will have the specified number of bytes.

    void

    setAsciiStream(int parameterIndex, InputStream x, long length)

    Sets the designated parameter to the given input stream, which will have the specified number of bytes.

    void

    Sets the designated parameter to the given java.math.BigDecimal value.

    void

    Sets the designated parameter to the given input stream.

    void

    Sets the designated parameter to the given input stream, which will have the specified number of bytes.

    void

    setBinaryStream(int parameterIndex, InputStream x, long length)

    Sets the designated parameter to the given input stream, which will have the specified number of bytes.

    void

    Sets the designated parameter to a InputStream object.

    void

    setBlob(int parameterIndex, InputStream inputStream, long length)

    Sets the designated parameter to a InputStream object.

    void

    setBlob(int parameterIndex, Blob x)

    Sets the designated parameter to the given java.sql.Blob object.

    void

    setBoolean(int parameterIndex, boolean x)

    Sets the designated parameter to the given Java boolean value.

    void

    setByte(int parameterIndex, byte x)

    Sets the designated parameter to the given Java byte value.

    void

    setBytes(int parameterIndex, byte[] x)

    Sets the designated parameter to the given Java array of bytes.

    void

    setCharacterStream(int parameterIndex, Reader reader)

    Sets the designated parameter to the given Reader object.

    void

    setCharacterStream(int parameterIndex, Reader reader, int length)

    Sets the designated parameter to the given Reader object, which is the given number of characters long.

    void

    setCharacterStream(int parameterIndex, Reader reader, long length)

    Sets the designated parameter to the given Reader object, which is the given number of characters long.

    void

    setClob(int parameterIndex, Reader reader)

    Sets the designated parameter to a Reader object.

    void

    setClob(int parameterIndex, Reader reader, long length)

    Sets the designated parameter to a Reader object.

    void

    setClob(int parameterIndex, Clob x)

    Sets the designated parameter to the given java.sql.Clob object.

    void

    setDate(int parameterIndex, Date x)

    Sets the designated parameter to the given java.sql.Date value using the default time zone of the virtual machine that is running the application.

    void

    Sets the designated parameter to the given java.sql.Date value, using the given Calendar object.

    void

    setDouble(int parameterIndex, double x)

    Sets the designated parameter to the given Java double value.

    void

    setFloat(int parameterIndex, float x)

    Sets the designated parameter to the given Java float value.

    void

    setInt(int parameterIndex, int x)

    Sets the designated parameter to the given Java int value.

    void

    setLong(int parameterIndex, long x)

    Sets the designated parameter to the given Java long value.

    void

    setNCharacterStream(int parameterIndex, Reader value)

    Sets the designated parameter to a Reader object.

    void

    setNCharacterStream(int parameterIndex, Reader value, long length)

    Sets the designated parameter to a Reader object.

    void

    setNClob(int parameterIndex, Reader reader)

    Sets the designated parameter to a Reader object.

    void

    setNClob(int parameterIndex, Reader reader, long length)

    Sets the designated parameter to a Reader object.

    void

    setNClob(int parameterIndex, NClob value)

    Sets the designated parameter to a java.sql.NClob object.

    void

    setNString(int parameterIndex, String value)

    Sets the designated parameter to the given String object.

    void

    setNull(int parameterIndex, int sqlType)

    Sets the designated parameter to SQL NULL.

    void

    setNull(int parameterIndex, int sqlType, String typeName)

    Sets the designated parameter to SQL NULL.

    void

    setObject(int parameterIndex, Object x)

    Sets the value of the designated parameter using the given object.

    void

    setObject(int parameterIndex, Object x, int targetSqlType)

    Sets the value of the designated parameter with the given object.

    void

    setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)

    Sets the value of the designated parameter with the given object.

    default void

    Sets the value of the designated parameter with the given object.

    default void

    setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength)

    Sets the value of the designated parameter with the given object.

    void

    setRef(int parameterIndex, Ref x)

    Sets the designated parameter to the given REF(<structured-type>) value.

    void

    setRowId(int parameterIndex, RowId x)

    Sets the designated parameter to the given java.sql.RowId object.

    void

    setShort(int parameterIndex, short x)

    Sets the designated parameter to the given Java short value.

    void

    setSQLXML(int parameterIndex, SQLXML xmlObject)

    Sets the designated parameter to the given java.sql.SQLXML object.

    void

    setString(int parameterIndex, String x)

    Sets the designated parameter to the given Java String value.

    void

    setTime(int parameterIndex, Time x)

    Sets the designated parameter to the given java.sql.Time value.

    void

    Sets the designated parameter to the given java.sql.Time value, using the given Calendar object.

    void

    Sets the designated parameter to the given java.sql.Timestamp value.

    void

    Sets the designated parameter to the given java.sql.Timestamp value, using the given Calendar object.

    void

    void

    setURL(int parameterIndex, URL x)

    Sets the designated parameter to the given java.net.URL value.

    Methods declared in interface Statement

    addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout

    void

    Adds the given SQL command to the current list of commands for this Statement object.

    void

    Cancels this Statement object if both the DBMS and driver support aborting an SQL statement.

    void

    Empties this Statement object's current list of SQL commands.

    void

    Clears all the warnings reported on this Statement object.

    void

    Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.

    void

    Specifies that this Statement will be closed when all its dependent result sets are closed.

    Returns a String enclosed in single quotes.

    Returns a String representing a National Character Set Literal enclosed in single quotes and prefixed with a upper case letter N.

    boolean

    Executes the given SQL statement, which may return multiple results.

    boolean

    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.

    boolean

    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.

    boolean

    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.

    int[]

    Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.

    default long[]

    Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.

    default long

    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.

    default long

    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.

    default long

    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.

    default long

    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.

    Executes the given SQL statement, which returns a single ResultSet object.

    int

    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.

    int

    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.

    int

    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.

    int

    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.

    Retrieves the Connection object that produced this Statement object.

    int

    Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object.

    int

    Retrieves the number of result set rows that is the default fetch size for ResultSet objects generated from this Statement object.

    Retrieves any auto-generated keys created as a result of executing this Statement object.

    default long

    Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain.

    default long

    Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned.

    int

    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.

    int

    Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain.

    boolean

    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.

    boolean

    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.

    int

    Retrieves the number of seconds the driver will wait for a Statement object to execute.

    Retrieves the current result as a ResultSet object.

    int

    Retrieves the result set concurrency for ResultSet objects generated by this Statement object.

    int

    Retrieves the result set holdability for ResultSet objects generated by this Statement object.

    int

    Retrieves the result set type for ResultSet objects generated by this Statement object.

    int

    Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned.

    Retrieves the first warning reported by calls on this Statement object.

    boolean

    Retrieves whether this Statement object has been closed.

    boolean

    Returns a value indicating whether this Statement will be closed when all its dependent result sets are closed.

    boolean

    Returns a value indicating whether the Statement is poolable or not.

    default boolean

    Returns whether identifier is a simple SQL identifier.

    void

    Sets the SQL cursor name to the given String, which will be used by subsequent Statement object execute methods.

    void

    Sets escape processing on or off.

    void

    Gives the driver a hint as to the direction in which rows will be processed in ResultSet objects created using this Statement object.

    void

    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 generated by this Statement.

    default void

    Sets the limit for the maximum number of rows that any ResultSet object generated by this Statement object can contain to the given number.

    void

    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.

    void

    Sets the limit for the maximum number of rows that any ResultSet object generated by this Statement object can contain to the given number.

    void

    Requests that a Statement be pooled or not pooled.

    void

    Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.

    Methods declared in interface Wrapper

    isWrapperFor, unwrap

    boolean

    Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.

    <T> T

    Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.

  • Method Details

    • executeQuery

    • executeUpdate

    • setNull

    • setBoolean

    • setByte

    • setShort

    • setInt

    • setLong

    • setFloat

    • setDouble

    • setBigDecimal

    • setString

    • setBytes

    • setDate

    • setTime

    • setTimestamp

    • setAsciiStream

    • setUnicodeStream

    • setBinaryStream

    • clearParameters

    • setObject

    • setObject

    • execute

    • addBatch

    • setCharacterStream

    • setRef

    • setBlob

    • setClob

    • setArray

    • getMetaData

    • setDate

    • setTime

    • setTimestamp

    • setNull

    • setURL

    • getParameterMetaData

    • setRowId

    • setNString

    • setNCharacterStream

    • setNClob

    • setClob

    • setBlob

    • setNClob

    • setSQLXML

    • setObject

    • setAsciiStream

    • setBinaryStream

    • setCharacterStream

    • setAsciiStream

    • setBinaryStream

    • setCharacterStream

    • setNCharacterStream

    • setClob

    • setBlob

    • setNClob

    • setObject

    • setObject

    • executeLargeUpdate