Package org.h2.jdbc

Class JdbcStatement

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.sql.Statement, java.sql.Wrapper, JdbcStatementBackwardsCompat
    Direct Known Subclasses:
    JdbcPreparedStatement

    public class JdbcStatement
    extends TraceObject
    implements java.sql.Statement, JdbcStatementBackwardsCompat
    Represents a statement.

    Thread safety: the statement is not thread-safe. If the same statement is used by multiple threads access to it must be synchronized. The single synchronized block must include execution of the command and all operations with its result.

     synchronized (stat) {
         try (ResultSet rs = stat.executeQuery(queryString)) {
             while (rs.next) {
                 // Do something
             }
         }
     }
     synchronized (stat) {
         updateCount = stat.executeUpdate(commandString);
     }
     
    • Field Detail

      • session

        protected Session session
      • maxRows

        protected long maxRows
      • fetchSize

        protected int fetchSize
      • updateCount

        protected long updateCount
      • resultSetType

        protected final int resultSetType
      • resultSetConcurrency

        protected final int resultSetConcurrency
      • batchCommands

        private java.util.ArrayList<java.lang.String> batchCommands
      • escapeProcessing

        private boolean escapeProcessing
      • cancelled

        private volatile boolean cancelled
      • closeOnCompletion

        private boolean closeOnCompletion
    • Constructor Detail

      • JdbcStatement

        JdbcStatement​(JdbcConnection conn,
                      int id,
                      int resultSetType,
                      int resultSetConcurrency)
    • Method Detail

      • executeQuery

        public java.sql.ResultSet executeQuery​(java.lang.String sql)
                                        throws java.sql.SQLException
        Executes a query (select statement) and returns the result set. If another result set exists for this statement, this will be closed (even if this statement fails).
        Specified by:
        executeQuery in interface java.sql.Statement
        Parameters:
        sql - the SQL statement to execute
        Returns:
        the result set
        Throws:
        java.sql.SQLException
      • executeUpdate

        public final int executeUpdate​(java.lang.String sql)
                                throws java.sql.SQLException
        Executes a statement (insert, update, delete, create, drop) and returns the update count. This method is not allowed for prepared statements. If another result set exists for this statement, this will be closed (even if this statement fails). If auto commit is on, this statement will be committed. If the statement is a DDL statement (create, drop, alter) and does not throw an exception, the current transaction (if any) is committed after executing the statement.
        Specified by:
        executeUpdate in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        Returns:
        the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, or Statement.SUCCESS_NO_INFO if number of rows is too large for the int data type)
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
        See Also:
        executeLargeUpdate(String)
      • executeLargeUpdate

        public final long executeLargeUpdate​(java.lang.String sql)
                                      throws java.sql.SQLException
        Executes a statement (insert, update, delete, create, drop) and returns the update count. This method is not allowed for prepared statements. If another result set exists for this statement, this will be closed (even if this statement fails). If auto commit is on, this statement will be committed. If the statement is a DDL statement (create, drop, alter) and does not throw an exception, the current transaction (if any) is committed after executing the statement.
        Specified by:
        executeLargeUpdate in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        Returns:
        the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing)
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
      • executeUpdateInternal

        private long executeUpdateInternal​(java.lang.String sql,
                                           java.lang.Object generatedKeysRequest)
      • execute

        public final boolean execute​(java.lang.String sql)
                              throws java.sql.SQLException
        Executes a statement and returns type of its result. This method is not allowed for prepared statements. If another result set exists for this statement, this will be closed (even if this statement fails). If the statement is a create or drop and does not throw an exception, the current transaction (if any) is committed after executing the statement. If auto commit is on, and the statement is not a select, this statement will be committed.
        Specified by:
        execute in interface java.sql.Statement
        Parameters:
        sql - the SQL statement to execute
        Returns:
        true if result is a result set, false otherwise
        Throws:
        java.sql.SQLException
      • executeInternal

        private boolean executeInternal​(java.lang.String sql,
                                        java.lang.Object generatedKeysRequest)
      • getResultSet

        public java.sql.ResultSet getResultSet()
                                        throws java.sql.SQLException
        Returns the last result set produces by this statement.
        Specified by:
        getResultSet in interface java.sql.Statement
        Returns:
        the result set
        Throws:
        java.sql.SQLException
      • getUpdateCount

        public final int getUpdateCount()
                                 throws java.sql.SQLException
        Returns the last update count of this statement.
        Specified by:
        getUpdateCount in interface java.sql.Statement
        Returns:
        the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, or -1 if statement was a query, or Statement.SUCCESS_NO_INFO if number of rows is too large for the int data type)
        Throws:
        java.sql.SQLException - if this object is closed or invalid
        See Also:
        getLargeUpdateCount()
      • getLargeUpdateCount

        public final long getLargeUpdateCount()
                                       throws java.sql.SQLException
        Returns the last update count of this statement.
        Specified by:
        getLargeUpdateCount in interface java.sql.Statement
        Returns:
        the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, or -1 if statement was a query)
        Throws:
        java.sql.SQLException - if this object is closed or invalid
      • close

        public void close()
                   throws java.sql.SQLException
        Closes this statement. All result sets that where created by this statement become invalid after calling this method.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.sql.Statement
        Throws:
        java.sql.SQLException
      • closeInternal

        private void closeInternal()
      • getConnection

        public java.sql.Connection getConnection()
        Returns the connection that created this object.
        Specified by:
        getConnection in interface java.sql.Statement
        Returns:
        the connection
      • getWarnings

        public java.sql.SQLWarning getWarnings()
                                        throws java.sql.SQLException
        Gets the first warning reported by calls on this object. This driver does not support warnings, and will always return null.
        Specified by:
        getWarnings in interface java.sql.Statement
        Returns:
        null
        Throws:
        java.sql.SQLException
      • clearWarnings

        public void clearWarnings()
                           throws java.sql.SQLException
        Clears all warnings. As this driver does not support warnings, this call is ignored.
        Specified by:
        clearWarnings in interface java.sql.Statement
        Throws:
        java.sql.SQLException
      • setCursorName

        public void setCursorName​(java.lang.String name)
                           throws java.sql.SQLException
        Sets the name of the cursor. This call is ignored.
        Specified by:
        setCursorName in interface java.sql.Statement
        Parameters:
        name - ignored
        Throws:
        java.sql.SQLException - if this object is closed
      • setFetchDirection

        public void setFetchDirection​(int direction)
                               throws java.sql.SQLException
        Sets the fetch direction. This call is ignored by this driver.
        Specified by:
        setFetchDirection in interface java.sql.Statement
        Parameters:
        direction - ignored
        Throws:
        java.sql.SQLException - if this object is closed
      • getFetchDirection

        public int getFetchDirection()
                              throws java.sql.SQLException
        Gets the fetch direction.
        Specified by:
        getFetchDirection in interface java.sql.Statement
        Returns:
        FETCH_FORWARD
        Throws:
        java.sql.SQLException - if this object is closed
      • getMaxRows

        public int getMaxRows()
                       throws java.sql.SQLException
        Gets the maximum number of rows for a ResultSet.
        Specified by:
        getMaxRows in interface java.sql.Statement
        Returns:
        the number of rows where 0 means no limit
        Throws:
        java.sql.SQLException - if this object is closed
      • getLargeMaxRows

        public long getLargeMaxRows()
                             throws java.sql.SQLException
        Gets the maximum number of rows for a ResultSet.
        Specified by:
        getLargeMaxRows in interface java.sql.Statement
        Returns:
        the number of rows where 0 means no limit
        Throws:
        java.sql.SQLException - if this object is closed
      • setMaxRows

        public void setMaxRows​(int maxRows)
                        throws java.sql.SQLException
        Gets the maximum number of rows for a ResultSet.
        Specified by:
        setMaxRows in interface java.sql.Statement
        Parameters:
        maxRows - the number of rows where 0 means no limit
        Throws:
        java.sql.SQLException - if this object is closed
      • setLargeMaxRows

        public void setLargeMaxRows​(long maxRows)
                             throws java.sql.SQLException
        Gets the maximum number of rows for a ResultSet.
        Specified by:
        setLargeMaxRows in interface java.sql.Statement
        Parameters:
        maxRows - the number of rows where 0 means no limit
        Throws:
        java.sql.SQLException - if this object is closed
      • setFetchSize

        public void setFetchSize​(int rows)
                          throws java.sql.SQLException
        Sets the number of rows suggested to read in one step. This value cannot be higher than the maximum rows (setMaxRows) set by the statement or prepared statement, otherwise an exception is throws. Setting the value to 0 will set the default value. The default value can be changed using the system property h2.serverResultSetFetchSize.
        Specified by:
        setFetchSize in interface java.sql.Statement
        Parameters:
        rows - the number of rows
        Throws:
        java.sql.SQLException - if this object is closed
      • getFetchSize

        public int getFetchSize()
                         throws java.sql.SQLException
        Gets the number of rows suggested to read in one step.
        Specified by:
        getFetchSize in interface java.sql.Statement
        Returns:
        the current fetch size
        Throws:
        java.sql.SQLException - if this object is closed
      • getResultSetConcurrency

        public int getResultSetConcurrency()
                                    throws java.sql.SQLException
        Gets the result set concurrency created by this object.
        Specified by:
        getResultSetConcurrency in interface java.sql.Statement
        Returns:
        the concurrency
        Throws:
        java.sql.SQLException
      • getResultSetType

        public int getResultSetType()
                             throws java.sql.SQLException
        Gets the result set type.
        Specified by:
        getResultSetType in interface java.sql.Statement
        Returns:
        the type
        Throws:
        java.sql.SQLException - if this object is closed
      • getMaxFieldSize

        public int getMaxFieldSize()
                            throws java.sql.SQLException
        Gets the maximum number of bytes for a result set column.
        Specified by:
        getMaxFieldSize in interface java.sql.Statement
        Returns:
        always 0 for no limit
        Throws:
        java.sql.SQLException - if this object is closed
      • setMaxFieldSize

        public void setMaxFieldSize​(int max)
                             throws java.sql.SQLException
        Sets the maximum number of bytes for a result set column. This method does currently do nothing for this driver.
        Specified by:
        setMaxFieldSize in interface java.sql.Statement
        Parameters:
        max - the maximum size - ignored
        Throws:
        java.sql.SQLException - if this object is closed
      • setEscapeProcessing

        public void setEscapeProcessing​(boolean enable)
                                 throws java.sql.SQLException
        Enables or disables processing or JDBC escape syntax. See also Connection.nativeSQL.
        Specified by:
        setEscapeProcessing in interface java.sql.Statement
        Parameters:
        enable - - true (default) or false (no conversion is attempted)
        Throws:
        java.sql.SQLException - if this object is closed
      • cancel

        public void cancel()
                    throws java.sql.SQLException
        Cancels a currently running statement. This method must be called from within another thread than the execute method. Operations on large objects are not interrupted, only operations that process many rows.
        Specified by:
        cancel in interface java.sql.Statement
        Throws:
        java.sql.SQLException - if this object is closed
      • isCancelled

        public boolean isCancelled()
        Check whether the statement was cancelled.
        Returns:
        true if yes
      • getQueryTimeout

        public int getQueryTimeout()
                            throws java.sql.SQLException
        Gets the current query timeout in seconds. This method will return 0 if no query timeout is set. The result is rounded to the next second. For performance reasons, only the first call to this method will query the database. If the query timeout was changed in another way than calling setQueryTimeout, this method will always return the last value.
        Specified by:
        getQueryTimeout in interface java.sql.Statement
        Returns:
        the timeout in seconds
        Throws:
        java.sql.SQLException - if this object is closed
      • setQueryTimeout

        public void setQueryTimeout​(int seconds)
                             throws java.sql.SQLException
        Sets the current query timeout in seconds. Changing the value will affect all statements of this connection. This method does not commit a transaction, and rolling back a transaction does not affect this setting.
        Specified by:
        setQueryTimeout in interface java.sql.Statement
        Parameters:
        seconds - the timeout in seconds - 0 means no timeout, values smaller 0 will throw an exception
        Throws:
        java.sql.SQLException - if this object is closed
      • addBatch

        public void addBatch​(java.lang.String sql)
                      throws java.sql.SQLException
        Adds a statement to the batch.
        Specified by:
        addBatch in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        Throws:
        java.sql.SQLException
      • clearBatch

        public void clearBatch()
                        throws java.sql.SQLException
        Clears the batch.
        Specified by:
        clearBatch in interface java.sql.Statement
        Throws:
        java.sql.SQLException
      • executeBatch

        public int[] executeBatch()
                           throws java.sql.SQLException
        Executes the batch. If one of the batched statements fails, this database will continue.
        Specified by:
        executeBatch in interface java.sql.Statement
        Returns:
        the array of update counts
        Throws:
        java.sql.SQLException
        See Also:
        executeLargeBatch()
      • executeLargeBatch

        public long[] executeLargeBatch()
                                 throws java.sql.SQLException
        Executes the batch. If one of the batched statements fails, this database will continue.
        Specified by:
        executeLargeBatch in interface java.sql.Statement
        Returns:
        the array of update counts
        Throws:
        java.sql.SQLException
      • executeBatchElement

        private long executeBatchElement​(java.lang.String sql,
                                         java.sql.SQLException exception)
      • getGeneratedKeys

        public java.sql.ResultSet getGeneratedKeys()
                                            throws java.sql.SQLException
        Return a result set with generated keys from the latest executed command or an empty result set if keys were not generated or were not requested with Statement.RETURN_GENERATED_KEYS, column indexes, or column names.

        Generated keys are only returned from from INSERT, UPDATE, MERGE INTO, and MERGE INTO ... USING commands.

        If SQL command inserts or updates multiple rows with generated keys each such inserted or updated row is returned. Batch methods are also supported.

        When Statement.RETURN_GENERATED_KEYS is used H2 chooses columns to return automatically. The following columns are chosen:

        • Columns with sequences including IDENTITY columns and columns with AUTO_INCREMENT.
        • Columns with other default values that are not evaluated into constant expressions (like DEFAULT RANDOM_UUID()).
        • Columns that are included into the PRIMARY KEY constraint.

        Exact required columns for the returning result set may be specified on execution of command with names or indexes of columns.

        Specified by:
        getGeneratedKeys in interface java.sql.Statement
        Returns:
        the possibly empty result set with generated keys
        Throws:
        java.sql.SQLException - if this object is closed
      • getMoreResults

        public boolean getMoreResults()
                               throws java.sql.SQLException
        Moves to the next result set - however there is always only one result set. This call also closes the current result set (if there is one). Returns true if there is a next result set (that means - it always returns false).
        Specified by:
        getMoreResults in interface java.sql.Statement
        Returns:
        false
        Throws:
        java.sql.SQLException - if this object is closed.
      • getMoreResults

        public boolean getMoreResults​(int current)
                               throws java.sql.SQLException
        Move to the next result set. This method always returns false.
        Specified by:
        getMoreResults in interface java.sql.Statement
        Parameters:
        current - Statement.CLOSE_CURRENT_RESULT, Statement.KEEP_CURRENT_RESULT, or Statement.CLOSE_ALL_RESULTS
        Returns:
        false
        Throws:
        java.sql.SQLException
      • executeUpdate

        public final int executeUpdate​(java.lang.String sql,
                                       int autoGeneratedKeys)
                                throws java.sql.SQLException
        Executes a statement and returns the update count. This method is not allowed for prepared statements.
        Specified by:
        executeUpdate in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        autoGeneratedKeys - Statement.RETURN_GENERATED_KEYS if generated keys should be available for retrieval, Statement.NO_GENERATED_KEYS if generated keys should not be available
        Returns:
        the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, or Statement.SUCCESS_NO_INFO if number of rows is too large for the int data type)
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
        See Also:
        executeLargeUpdate(String, int)
      • executeLargeUpdate

        public final long executeLargeUpdate​(java.lang.String sql,
                                             int autoGeneratedKeys)
                                      throws java.sql.SQLException
        Executes a statement and returns the update count. This method is not allowed for prepared statements.
        Specified by:
        executeLargeUpdate in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        autoGeneratedKeys - Statement.RETURN_GENERATED_KEYS if generated keys should be available for retrieval, Statement.NO_GENERATED_KEYS if generated keys should not be available
        Returns:
        the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing)
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
      • executeUpdate

        public final int executeUpdate​(java.lang.String sql,
                                       int[] columnIndexes)
                                throws java.sql.SQLException
        Executes a statement and returns the update count. This method is not allowed for prepared statements.
        Specified by:
        executeUpdate in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        columnIndexes - an array of column indexes indicating the columns with generated keys that should be returned from the inserted row
        Returns:
        the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, or Statement.SUCCESS_NO_INFO if number of rows is too large for the int data type)
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
        See Also:
        executeLargeUpdate(String, int[])
      • executeLargeUpdate

        public final long executeLargeUpdate​(java.lang.String sql,
                                             int[] columnIndexes)
                                      throws java.sql.SQLException
        Executes a statement and returns the update count. This method is not allowed for prepared statements.
        Specified by:
        executeLargeUpdate in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        columnIndexes - an array of column indexes indicating the columns with generated keys that should be returned from the inserted row
        Returns:
        the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing)
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
      • executeUpdate

        public final int executeUpdate​(java.lang.String sql,
                                       java.lang.String[] columnNames)
                                throws java.sql.SQLException
        Executes a statement and returns the update count. This method is not allowed for prepared statements.
        Specified by:
        executeUpdate in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        columnNames - an array of column names indicating the columns with generated keys that should be returned from the inserted row
        Returns:
        the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returned nothing, or Statement.SUCCESS_NO_INFO if number of rows is too large for the int data type)
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
        See Also:
        executeLargeUpdate(String, String[])
      • executeLargeUpdate

        public final long executeLargeUpdate​(java.lang.String sql,
                                             java.lang.String[] columnNames)
                                      throws java.sql.SQLException
        Executes a statement and returns the update count. This method is not allowed for prepared statements.
        Specified by:
        executeLargeUpdate in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        columnNames - an array of column names indicating the columns with generated keys that should be returned from the inserted row
        Returns:
        the update count (number of row affected by an insert, update or delete, or 0 if no rows or the statement was a create, drop, commit or rollback)
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
      • execute

        public final boolean execute​(java.lang.String sql,
                                     int autoGeneratedKeys)
                              throws java.sql.SQLException
        Executes a statement and returns type of its result. This method is not allowed for prepared statements.
        Specified by:
        execute in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        autoGeneratedKeys - Statement.RETURN_GENERATED_KEYS if generated keys should be available for retrieval, Statement.NO_GENERATED_KEYS if generated keys should not be available
        Returns:
        true if result is a result set, false otherwise
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
      • execute

        public final boolean execute​(java.lang.String sql,
                                     int[] columnIndexes)
                              throws java.sql.SQLException
        Executes a statement and returns type of its result. This method is not allowed for prepared statements.
        Specified by:
        execute in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        columnIndexes - an array of column indexes indicating the columns with generated keys that should be returned from the inserted row
        Returns:
        true if result is a result set, false otherwise
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
      • execute

        public final boolean execute​(java.lang.String sql,
                                     java.lang.String[] columnNames)
                              throws java.sql.SQLException
        Executes a statement and returns type of its result. This method is not allowed for prepared statements.
        Specified by:
        execute in interface java.sql.Statement
        Parameters:
        sql - the SQL statement
        columnNames - an array of column names indicating the columns with generated keys that should be returned from the inserted row
        Returns:
        true if result is a result set, false otherwise
        Throws:
        java.sql.SQLException - if a database error occurred or a select statement was executed
      • getResultSetHoldability

        public int getResultSetHoldability()
                                    throws java.sql.SQLException
        Gets the result set holdability.
        Specified by:
        getResultSetHoldability in interface java.sql.Statement
        Returns:
        the holdability
        Throws:
        java.sql.SQLException
      • closeOnCompletion

        public void closeOnCompletion()
                               throws java.sql.SQLException
        Specifies that this statement will be closed when its dependent result set is closed.
        Specified by:
        closeOnCompletion in interface java.sql.Statement
        Throws:
        java.sql.SQLException - if this statement is closed
      • isCloseOnCompletion

        public boolean isCloseOnCompletion()
                                    throws java.sql.SQLException
        Returns whether this statement will be closed when its dependent result set is closed.
        Specified by:
        isCloseOnCompletion in interface java.sql.Statement
        Returns:
        true if this statement will be closed when its dependent result set is closed
        Throws:
        java.sql.SQLException - if this statement is closed
      • closeIfCloseOnCompletion

        void closeIfCloseOnCompletion()
      • checkClosed

        void checkClosed()
        Check if this connection is closed.
        Throws:
        DbException - if the connection or session is closed
      • closeOldResultSet

        protected void closeOldResultSet()
        INTERNAL. Close and old result set if there is still one open.
      • setExecutingStatement

        void setExecutingStatement​(CommandInterface c)
        INTERNAL. Set the statement that is currently running.
        Parameters:
        c - the command
      • onLazyResultSetClose

        void onLazyResultSetClose​(CommandInterface command,
                                  boolean closeCommand)
        Called when the result set is closed.
        Parameters:
        command - the command
        closeCommand - whether to close the command
      • isClosed

        public boolean isClosed()
                         throws java.sql.SQLException
        Returns whether this statement is closed.
        Specified by:
        isClosed in interface java.sql.Statement
        Returns:
        true if the statement is closed
        Throws:
        java.sql.SQLException
      • unwrap

        public <T> T unwrap​(java.lang.Class<T> iface)
                     throws java.sql.SQLException
        Return an object of this class if possible.
        Specified by:
        unwrap in interface java.sql.Wrapper
        Parameters:
        iface - the class
        Returns:
        this
        Throws:
        java.sql.SQLException
      • isWrapperFor

        public boolean isWrapperFor​(java.lang.Class<?> iface)
                             throws java.sql.SQLException
        Checks if unwrap can return an object of this class.
        Specified by:
        isWrapperFor in interface java.sql.Wrapper
        Parameters:
        iface - the class
        Returns:
        whether or not the interface is assignable from this class
        Throws:
        java.sql.SQLException
      • isPoolable

        public boolean isPoolable()
        Returns whether this object is poolable.
        Specified by:
        isPoolable in interface java.sql.Statement
        Returns:
        false
      • setPoolable

        public void setPoolable​(boolean poolable)
        Requests that this object should be pooled or not. This call is ignored.
        Specified by:
        setPoolable in interface java.sql.Statement
        Parameters:
        poolable - the requested value
      • enquoteIdentifier

        public java.lang.String enquoteIdentifier​(java.lang.String identifier,
                                                  boolean alwaysQuote)
                                           throws java.sql.SQLException
        Description copied from interface: JdbcStatementBackwardsCompat
        Enquotes the specified identifier.
        Specified by:
        enquoteIdentifier in interface JdbcStatementBackwardsCompat
        Specified by:
        enquoteIdentifier in interface java.sql.Statement
        Parameters:
        identifier - identifier to quote if required, may be quoted or unquoted
        alwaysQuote - if true identifier will be quoted unconditionally
        Returns:
        specified identifier quoted if required, explicitly requested, or if it was already quoted
        Throws:
        java.lang.NullPointerException - if identifier is null
        java.sql.SQLException - if identifier is not a valid identifier
      • checkQuotes

        private static void checkQuotes​(java.lang.String identifier,
                                        int offset,
                                        int length)
      • isSimpleIdentifier

        public boolean isSimpleIdentifier​(java.lang.String identifier)
                                   throws java.sql.SQLException
        Description copied from interface: JdbcStatementBackwardsCompat
        Checks if specified identifier may be used without quotes.
        Specified by:
        isSimpleIdentifier in interface JdbcStatementBackwardsCompat
        Specified by:
        isSimpleIdentifier in interface java.sql.Statement
        Parameters:
        identifier - identifier to check
        Returns:
        is specified identifier may be used without quotes
        Throws:
        java.lang.NullPointerException - if identifier is null
        java.sql.SQLException - on failure
      • toString

        public java.lang.String toString()
        INTERNAL
        Overrides:
        toString in class java.lang.Object