类 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(java.sql.Connection connection)Instantiates a new connection wrapper. -
方法概要
修饰符和类型 方法 说明 voidclearWarnings()Clear warnings.voidclose()Close.voidcommit()Commit.java.sql.ArraycreateArrayOf(java.lang.String typeName, java.lang.Object[] elements)Creates the array of.java.sql.BlobcreateBlob()Creates the blob.java.sql.ClobcreateClob()Creates the clob.java.sql.NClobcreateNClob()Creates the N clob.java.sql.SQLXMLcreateSQLXML()Creates the SQLXML.StatementWrappercreateStatement()Creates the statement.StatementWrappercreateStatement(int resultSetType, int resultSetConcurrency)Creates the statement.StatementWrappercreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)Creates the statement.java.sql.StructcreateStruct(java.lang.String typeName, java.lang.Object[] attributes)Creates the struct.booleangetAutoCommit()Gets the auto commit.java.lang.StringgetCatalog()Gets the catalog.java.util.PropertiesgetClientInfo()Gets the client info.java.lang.StringgetClientInfo(java.lang.String name)Gets the client info.java.sql.ConnectiongetConnection()Gets the connection.intgetHoldability()Gets the holdability.java.sql.DatabaseMetaDatagetMetaData()Gets the meta data.intgetTransactionIsolation()Gets the transaction isolation.java.util.Map<java.lang.String,java.lang.Class<?>>getTypeMap()Gets the type map.java.sql.SQLWarninggetWarnings()Gets the warnings.booleanisClosed()Checks if is closed.booleanisReadOnly()Checks if is read only.booleanisValid(int timeout)Checks if is valid.booleanisWrapperFor(java.lang.Class<?> iface)Checks if is wrapper for.java.lang.StringnativeSQL(java.lang.String sql)Native SQL.CallableStatementWrapperprepareCall(java.lang.String sql)Prepare call.CallableStatementWrapperprepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency)Prepare call.CallableStatementWrapperprepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)Prepare call.PreparedStatementWrapperprepareStatement(java.lang.String sql)Prepare statement.PreparedStatementWrapperprepareStatement(java.lang.String sql, int autoGeneratedKeys)Prepare statement.PreparedStatementWrapperprepareStatement(java.lang.String sql, int[] columnIndexes)Prepare statement.PreparedStatementWrapperprepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency)Prepare statement.PreparedStatementWrapperprepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)Prepare statement.PreparedStatementWrapperprepareStatement(java.lang.String sql, java.lang.String[] columnNames)Prepare statement.voidreleaseSavepoint(java.sql.Savepoint savepoint)Release savepoint.voidrollback()Rollback.voidrollback(java.sql.Savepoint savepoint)Rollback.voidsetAutoCommit(boolean autoCommit)Sets the auto commit.voidsetCatalog(java.lang.String catalog)Sets the catalog.voidsetClientInfo(java.lang.String name, java.lang.String value)Sets the client info.voidsetClientInfo(java.util.Properties properties)Sets the client info.voidsetHoldability(int holdability)Sets the holdability.voidsetReadOnly(boolean readOnly)Sets the read only.java.sql.SavepointsetSavepoint()Sets the savepoint.java.sql.SavepointsetSavepoint(java.lang.String name)Sets the savepoint.voidsetTransactionIsolation(int level)Sets the transaction isolation.voidsetTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)Sets the type map.<T> Tunwrap(java.lang.Class<T> iface)Unwrap.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
构造器详细资料
-
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.SQLExceptionCreates the array of.- 参数:
typeName- the type nameelements- 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
Creates the statement.- 返回:
- the statement wrapper
- 另请参阅:
Connection
-
createStatement
public StatementWrapper createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLExceptionCreates the statement.- 参数:
resultSetType- the result set typeresultSetConcurrency- 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.SQLExceptionCreates the statement.- 参数:
resultSetType- the result set typeresultSetConcurrency- the result set concurrencyresultSetHoldability- 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.SQLExceptionCreates the struct.- 参数:
typeName- the type nameattributes- 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
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 sqlresultSetType- the result set typeresultSetConcurrency- 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 sqlresultSetType- the result set typeresultSetConcurrency- the result set concurrencyresultSetHoldability- the result set holdability- 返回:
- the callable statement wrapper
- 另请参阅:
Connection
-
prepareStatement
Prepare statement.- 参数:
sql- the sql- 返回:
- the prepared statement wrapper
- 另请参阅:
Connection
-
prepareStatement
Prepare statement.- 参数:
sql- the sqlautoGeneratedKeys- the auto generated keys- 返回:
- the prepared statement wrapper
- 另请参阅:
Connection
-
prepareStatement
Prepare statement.- 参数:
sql- the sqlcolumnIndexes- the column indexes- 返回:
- the prepared statement wrapper
- 另请参阅:
Connection
-
prepareStatement
public PreparedStatementWrapper prepareStatement(java.lang.String sql, java.lang.String[] columnNames)Prepare statement.- 参数:
sql- the sqlcolumnNames- the column names- 返回:
- the prepared statement wrapper
- 另请参阅:
Connection
-
prepareStatement
public PreparedStatementWrapper prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency)Prepare statement.- 参数:
sql- the sqlresultSetType- the result set typeresultSetConcurrency- 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 sqlresultSetType- the result set typeresultSetConcurrency- the result set concurrencyresultSetHoldability- 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.SQLClientInfoExceptionSets the client info.- 参数:
name- the namevalue- 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)
-