类 StatementWrapper

java.lang.Object
cn.featherfly.common.db.wrapper.StatementWrapper
所有已实现的接口:
java.lang.AutoCloseable

public class StatementWrapper
extends java.lang.Object
implements java.lang.AutoCloseable

java.sql.Statement的包装类,包装所有检查异常(SQLEception)为非检查异常(JdbcException)

  • 构造器详细资料

    • StatementWrapper

      public StatementWrapper​(java.sql.Statement statement, ConnectionWrapper connectionWrapper)
      Instantiates a new statement wrapper.
      参数:
      statement - the statement
      connectionWrapper - the connection wrapper
  • 方法详细资料

    • addBatch

      public void addBatch​(java.lang.String sql)
      Adds the batch.
      参数:
      sql - the sql
      另请参阅:
      Statement.addBatch(String)
    • cancel

      public void cancel()
      Cancel.
      另请参阅:
      Statement.cancel()
    • clearBatch

      public void clearBatch()
      Clear batch.
      另请参阅:
      Statement.clearBatch()
    • clearWarnings

      public void clearWarnings()
      Clear warnings.
      另请参阅:
      Statement.clearWarnings()
    • close

      public void close()
      Close.
      指定者:
      close 在接口中 java.lang.AutoCloseable
      另请参阅:
      Statement.close()
    • execute

      public boolean execute​(java.lang.String sql)
      Execute.
      参数:
      sql - the sql
      返回:
      true, if successful
      另请参阅:
      Statement
    • execute

      public boolean execute​(java.lang.String sql, int autoGeneratedKeys)
      Execute.
      参数:
      sql - the sql
      autoGeneratedKeys - the auto generated keys
      返回:
      true, if successful
      另请参阅:
      Statement
    • execute

      public boolean execute​(java.lang.String sql, int[] columnIndexes)
      Execute.
      参数:
      sql - the sql
      columnIndexes - the column indexes
      返回:
      true, if successful
      另请参阅:
      Statement
    • execute

      public boolean execute​(java.lang.String sql, java.lang.String[] columnNames)
      Execute.
      参数:
      sql - the sql
      columnNames - the column names
      返回:
      true, if successful
      另请参阅:
      Statement
    • executeBatch

      public int[] executeBatch()
      Execute batch.
      返回:
      the int[]
      另请参阅:
      Statement
    • executeQuery

      public java.sql.ResultSet executeQuery​(java.lang.String sql)
      Execute query.
      参数:
      sql - the sql
      返回:
      the result set
      另请参阅:
      Statement
    • executeUpdate

      public int executeUpdate​(java.lang.String sql)
      Execute update.
      参数:
      sql - the sql
      返回:
      the int
      另请参阅:
      Statement
    • executeUpdate

      public int executeUpdate​(java.lang.String sql, int autoGeneratedKeys)
      Execute update.
      参数:
      sql - the sql
      autoGeneratedKeys - the auto generated keys
      返回:
      the int
      另请参阅:
      Statement
    • executeUpdate

      public int executeUpdate​(java.lang.String sql, int[] columnIndexes)
      Execute update.
      参数:
      sql - the sql
      columnIndexes - the column indexes
      返回:
      the int
      另请参阅:
      Statement
    • executeUpdate

      public int executeUpdate​(java.lang.String sql, java.lang.String[] columnNames)
      Execute update.
      参数:
      sql - the sql
      columnNames - the column names
      返回:
      the int
      另请参阅:
      Statement
    • getConnection

      public ConnectionWrapper getConnection()
      Gets the connection.
      返回:
      the connection
      另请参阅:
      Statement
    • getFetchDirection

      public int getFetchDirection()
      Gets the fetch direction.
      返回:
      the fetch direction
      另请参阅:
      Statement
    • getFetchSize

      public int getFetchSize()
      Gets the fetch size.
      返回:
      the fetch size
      另请参阅:
      Statement
    • getGeneratedKeys

      public java.sql.ResultSet getGeneratedKeys()
      Gets the generated keys.
      返回:
      the generated keys
      另请参阅:
      Statement
    • getMaxFieldSize

      public int getMaxFieldSize()
      Gets the max field size.
      返回:
      the max field size
      另请参阅:
      Statement
    • getMaxRows

      public int getMaxRows()
      Gets the max rows.
      返回:
      the max rows
      另请参阅:
      Statement
    • getMoreResults

      public boolean getMoreResults()
      Gets the more results.
      返回:
      the more results
      另请参阅:
      Statement
    • getMoreResults

      public boolean getMoreResults​(int current)
      Gets the more results.
      参数:
      current - the current
      返回:
      the more results
      另请参阅:
      Statement
    • getQueryTimeout

      public int getQueryTimeout()
      Gets the query timeout.
      返回:
      the query timeout
      另请参阅:
      Statement
    • getResultSet

      public java.sql.ResultSet getResultSet()
      Gets the result set.
      返回:
      the result set
      另请参阅:
      Statement
    • getResultSetConcurrency

      public int getResultSetConcurrency()
      Gets the result set concurrency.
      返回:
      the result set concurrency
      另请参阅:
      Statement
    • getResultSetHoldability

      public int getResultSetHoldability()
      Gets the result set holdability.
      返回:
      the result set holdability
      另请参阅:
      Statement
    • getResultSetType

      public int getResultSetType()
      Gets the result set type.
      返回:
      the result set type
      另请参阅:
      Statement
    • getUpdateCount

      public int getUpdateCount()
      Gets the update count.
      返回:
      the update count
      另请参阅:
      Statement
    • getWarnings

      public java.sql.SQLWarning getWarnings()
      Gets the warnings.
      返回:
      the warnings
      另请参阅:
      Statement
    • isClosed

      public boolean isClosed()
      Checks if is closed.
      返回:
      true, if is closed
      另请参阅:
      Statement
    • isPoolable

      public boolean isPoolable()
      Checks if is poolable.
      返回:
      true, if is poolable
      另请参阅:
      Statement
    • setCursorName

      public void setCursorName​(java.lang.String name)
      Sets the cursor name.
      参数:
      name - the new cursor name
      另请参阅:
      Statement
    • setEscapeProcessing

      public void setEscapeProcessing​(boolean enable)
      Sets the escape processing.
      参数:
      enable - the new escape processing
      另请参阅:
      Statement
    • setFetchDirection

      public void setFetchDirection​(int direction)
      Sets the fetch direction.
      参数:
      direction - the new fetch direction
      另请参阅:
      Statement
    • setFetchSize

      public void setFetchSize​(int rows)
      Sets the fetch size.
      参数:
      rows - the new fetch size
      另请参阅:
      Statement
    • setMaxFieldSize

      public void setMaxFieldSize​(int max)
      Sets the max field size.
      参数:
      max - the new max field size
      另请参阅:
      Statement
    • setMaxRows

      public void setMaxRows​(int max)
      Sets the max rows.
      参数:
      max - the new max rows
      另请参阅:
      Statement
    • setPoolable

      public void setPoolable​(boolean poolable)
      Sets the poolable.
      参数:
      poolable - the new poolable
      另请参阅:
      Statement
    • setQueryTimeout

      public void setQueryTimeout​(int seconds)
      Sets the query timeout.
      参数:
      seconds - the new query timeout
      另请参阅:
      Statement
    • isWrapperFor

      public boolean isWrapperFor​(java.lang.Class<?> iface)
      Checks if is wrapper for.
      参数:
      iface - the iface
      返回:
      true, if is wrapper for
      另请参阅:
      Statement
    • unwrap

      public <T> T unwrap​(java.lang.Class<T> iface)
      Unwrap.
      类型参数:
      T - the generic type
      参数:
      iface - the iface
      返回:
      the t
      另请参阅:
      Statement
    • getStatement

      public java.sql.Statement getStatement()
      Gets the statement.
      返回:
      返回statement(java.sql.Statement)