类 ConnectionWrapper

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

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

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

  • 构造器详细资料

    • ConnectionWrapper

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

    • clearWarnings

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

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

      public void commit()
      Commit.
      另请参阅:
      Connection
    • createArrayOf

      public java.sql.Array createArrayOf​(java.lang.String typeName, java.lang.Object[] elements) throws java.sql.SQLException
      Creates the array of.
      参数:
      typeName - the type name
      elements - the elements
      返回:
      the array
      抛出:
      java.sql.SQLException - the SQL exception
      另请参阅:
      Connection
    • createBlob

      public java.sql.Blob createBlob()
      Creates the blob.
      返回:
      the blob
      另请参阅:
      Connection
    • createClob

      public java.sql.Clob createClob()
      Creates the clob.
      返回:
      the clob
      另请参阅:
      Connection
    • createNClob

      public java.sql.NClob createNClob()
      Creates the N clob.
      返回:
      the n clob
      另请参阅:
      Connection
    • createSQLXML

      public java.sql.SQLXML createSQLXML()
      Creates the SQLXML.
      返回:
      the sqlxml
      另请参阅:
      Connection
    • createStatement

      public StatementWrapper createStatement()
      Creates the statement.
      返回:
      the statement wrapper
      另请参阅:
      Connection
    • createStatement

      public StatementWrapper createStatement​(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
      Creates the statement.
      参数:
      resultSetType - the result set type
      resultSetConcurrency - the result set concurrency
      返回:
      the statement wrapper
      抛出:
      java.sql.SQLException - the SQL exception
      另请参阅:
      Connection
    • createStatement

      public StatementWrapper createStatement​(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
      Creates the statement.
      参数:
      resultSetType - the result set type
      resultSetConcurrency - the result set concurrency
      resultSetHoldability - the result set holdability
      返回:
      the statement wrapper
      抛出:
      java.sql.SQLException - the SQL exception
      另请参阅:
      Connection
    • createStruct

      public java.sql.Struct createStruct​(java.lang.String typeName, java.lang.Object[] attributes) throws java.sql.SQLException
      Creates the struct.
      参数:
      typeName - the type name
      attributes - the attributes
      返回:
      the struct
      抛出:
      java.sql.SQLException - the SQL exception
      另请参阅:
      Connection
    • getAutoCommit

      public boolean getAutoCommit()
      Gets the auto commit.
      返回:
      the auto commit
      另请参阅:
      Connection
    • getCatalog

      public java.lang.String getCatalog()
      Gets the catalog.
      返回:
      the catalog
      另请参阅:
      Connection
    • getClientInfo

      public java.util.Properties getClientInfo()
      Gets the client info.
      返回:
      the client info
      另请参阅:
      Connection
    • getClientInfo

      public java.lang.String getClientInfo​(java.lang.String name)
      Gets the client info.
      参数:
      name - the name
      返回:
      the client info
      另请参阅:
      Connection
    • getHoldability

      public int getHoldability()
      Gets the holdability.
      返回:
      the holdability
      另请参阅:
      Connection
    • getMetaData

      public java.sql.DatabaseMetaData getMetaData()
      Gets the meta data.
      返回:
      the meta data
      另请参阅:
      Connection
    • getTransactionIsolation

      public int getTransactionIsolation()
      Gets the transaction isolation.
      返回:
      the transaction isolation
      另请参阅:
      Connection
    • getTypeMap

      public java.util.Map<java.lang.String,​java.lang.Class<?>> getTypeMap()
      Gets the type map.
      返回:
      the type map
      另请参阅:
      Connection
    • getWarnings

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

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

      public boolean isReadOnly()
      Checks if is read only.
      返回:
      true, if is read only
      另请参阅:
      Connection
    • isValid

      public boolean isValid​(int timeout)
      Checks if is valid.
      参数:
      timeout - the timeout
      返回:
      true, if is valid
      另请参阅:
      Connection
    • nativeSQL

      public java.lang.String nativeSQL​(java.lang.String sql)
      Native SQL.
      参数:
      sql - the sql
      返回:
      the string
      另请参阅:
      Connection
    • prepareCall

      public CallableStatementWrapper prepareCall​(java.lang.String sql)
      Prepare call.
      参数:
      sql - the sql
      返回:
      the callable statement wrapper
      另请参阅:
      Connection
    • prepareCall

      public CallableStatementWrapper prepareCall​(java.lang.String sql, int resultSetType, int resultSetConcurrency)
      Prepare call.
      参数:
      sql - the sql
      resultSetType - the result set type
      resultSetConcurrency - the result set concurrency
      返回:
      the callable statement wrapper
      另请参阅:
      Connection
    • prepareCall

      public CallableStatementWrapper prepareCall​(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
      Prepare call.
      参数:
      sql - the sql
      resultSetType - the result set type
      resultSetConcurrency - the result set concurrency
      resultSetHoldability - the result set holdability
      返回:
      the callable statement wrapper
      另请参阅:
      Connection
    • prepareStatement

      public PreparedStatementWrapper prepareStatement​(java.lang.String sql)
      Prepare statement.
      参数:
      sql - the sql
      返回:
      the prepared statement wrapper
      另请参阅:
      Connection
    • prepareStatement

      public PreparedStatementWrapper prepareStatement​(java.lang.String sql, int autoGeneratedKeys)
      Prepare statement.
      参数:
      sql - the sql
      autoGeneratedKeys - the auto generated keys
      返回:
      the prepared statement wrapper
      另请参阅:
      Connection
    • prepareStatement

      public PreparedStatementWrapper prepareStatement​(java.lang.String sql, int[] columnIndexes)
      Prepare statement.
      参数:
      sql - the sql
      columnIndexes - the column indexes
      返回:
      the prepared statement wrapper
      另请参阅:
      Connection
    • prepareStatement

      public PreparedStatementWrapper prepareStatement​(java.lang.String sql, java.lang.String[] columnNames)
      Prepare statement.
      参数:
      sql - the sql
      columnNames - the column names
      返回:
      the prepared statement wrapper
      另请参阅:
      Connection
    • prepareStatement

      public PreparedStatementWrapper prepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency)
      Prepare statement.
      参数:
      sql - the sql
      resultSetType - the result set type
      resultSetConcurrency - the result set concurrency
      返回:
      the prepared statement wrapper
      另请参阅:
      Connection
    • prepareStatement

      public PreparedStatementWrapper prepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
      Prepare statement.
      参数:
      sql - the sql
      resultSetType - the result set type
      resultSetConcurrency - the result set concurrency
      resultSetHoldability - the result set holdability
      返回:
      the prepared statement wrapper
      另请参阅:
      Connection
    • releaseSavepoint

      public void releaseSavepoint​(java.sql.Savepoint savepoint)
      Release savepoint.
      参数:
      savepoint - the savepoint
      另请参阅:
      Connection
    • rollback

      public void rollback()
      Rollback.
      另请参阅:
      Connection
    • rollback

      public void rollback​(java.sql.Savepoint savepoint)
      Rollback.
      参数:
      savepoint - the savepoint
      另请参阅:
      Connection
    • setAutoCommit

      public void setAutoCommit​(boolean autoCommit)
      Sets the auto commit.
      参数:
      autoCommit - the new auto commit
      另请参阅:
      Connection
    • setCatalog

      public void setCatalog​(java.lang.String catalog)
      Sets the catalog.
      参数:
      catalog - the new catalog
      另请参阅:
      Connection
    • setClientInfo

      public void setClientInfo​(java.util.Properties properties)
      Sets the client info.
      参数:
      properties - the new client info
      另请参阅:
      Connection
    • setClientInfo

      public void setClientInfo​(java.lang.String name, java.lang.String value) throws java.sql.SQLClientInfoException
      Sets the client info.
      参数:
      name - the name
      value - the value
      抛出:
      java.sql.SQLClientInfoException - the SQL client info exception
      另请参阅:
      Connection
    • setHoldability

      public void setHoldability​(int holdability)
      Sets the holdability.
      参数:
      holdability - the new holdability
      另请参阅:
      Connection
    • setReadOnly

      public void setReadOnly​(boolean readOnly)
      Sets the read only.
      参数:
      readOnly - the new read only
      另请参阅:
      Connection
    • setSavepoint

      public java.sql.Savepoint setSavepoint()
      Sets the savepoint.
      返回:
      the savepoint
      另请参阅:
      Connection
    • setSavepoint

      public java.sql.Savepoint setSavepoint​(java.lang.String name)
      Sets the savepoint.
      参数:
      name - the name
      返回:
      the savepoint
      另请参阅:
      Connection
    • setTransactionIsolation

      public void setTransactionIsolation​(int level)
      Sets the transaction isolation.
      参数:
      level - the new transaction isolation
      另请参阅:
      Connection
    • setTypeMap

      public void setTypeMap​(java.util.Map<java.lang.String,​java.lang.Class<?>> map)
      Sets the type map.
      参数:
      map - the map
      另请参阅:
      Connection
    • isWrapperFor

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

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

      public java.sql.Connection getConnection()
      Gets the connection.
      返回:
      返回connection(java.sql.Connection)