类 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(java.sql.Statement statement, ConnectionWrapper connectionWrapper)Instantiates a new statement wrapper. -
方法概要
修饰符和类型 方法 说明 voidaddBatch(java.lang.String sql)Adds the batch.voidcancel()Cancel.voidclearBatch()Clear batch.voidclearWarnings()Clear warnings.voidclose()Close.booleanexecute(java.lang.String sql)Execute.booleanexecute(java.lang.String sql, int autoGeneratedKeys)Execute.booleanexecute(java.lang.String sql, int[] columnIndexes)Execute.booleanexecute(java.lang.String sql, java.lang.String[] columnNames)Execute.int[]executeBatch()Execute batch.java.sql.ResultSetexecuteQuery(java.lang.String sql)Execute query.intexecuteUpdate(java.lang.String sql)Execute update.intexecuteUpdate(java.lang.String sql, int autoGeneratedKeys)Execute update.intexecuteUpdate(java.lang.String sql, int[] columnIndexes)Execute update.intexecuteUpdate(java.lang.String sql, java.lang.String[] columnNames)Execute update.ConnectionWrappergetConnection()Gets the connection.intgetFetchDirection()Gets the fetch direction.intgetFetchSize()Gets the fetch size.java.sql.ResultSetgetGeneratedKeys()Gets the generated keys.intgetMaxFieldSize()Gets the max field size.intgetMaxRows()Gets the max rows.booleangetMoreResults()Gets the more results.booleangetMoreResults(int current)Gets the more results.intgetQueryTimeout()Gets the query timeout.java.sql.ResultSetgetResultSet()Gets the result set.intgetResultSetConcurrency()Gets the result set concurrency.intgetResultSetHoldability()Gets the result set holdability.intgetResultSetType()Gets the result set type.java.sql.StatementgetStatement()Gets the statement.intgetUpdateCount()Gets the update count.java.sql.SQLWarninggetWarnings()Gets the warnings.booleanisClosed()Checks if is closed.booleanisPoolable()Checks if is poolable.booleanisWrapperFor(java.lang.Class<?> iface)Checks if is wrapper for.voidsetCursorName(java.lang.String name)Sets the cursor name.voidsetEscapeProcessing(boolean enable)Sets the escape processing.voidsetFetchDirection(int direction)Sets the fetch direction.voidsetFetchSize(int rows)Sets the fetch size.voidsetMaxFieldSize(int max)Sets the max field size.voidsetMaxRows(int max)Sets the max rows.voidsetPoolable(boolean poolable)Sets the poolable.voidsetQueryTimeout(int seconds)Sets the query timeout.<T> Tunwrap(java.lang.Class<T> iface)Unwrap.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
构造器详细资料
-
StatementWrapper
Instantiates a new statement wrapper.- 参数:
statement- the statementconnectionWrapper- 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 sqlautoGeneratedKeys- the auto generated keys- 返回:
- true, if successful
- 另请参阅:
Statement
-
execute
public boolean execute(java.lang.String sql, int[] columnIndexes)Execute.- 参数:
sql- the sqlcolumnIndexes- the column indexes- 返回:
- true, if successful
- 另请参阅:
Statement
-
execute
public boolean execute(java.lang.String sql, java.lang.String[] columnNames)Execute.- 参数:
sql- the sqlcolumnNames- 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 sqlautoGeneratedKeys- the auto generated keys- 返回:
- the int
- 另请参阅:
Statement
-
executeUpdate
public int executeUpdate(java.lang.String sql, int[] columnIndexes)Execute update.- 参数:
sql- the sqlcolumnIndexes- the column indexes- 返回:
- the int
- 另请参阅:
Statement
-
executeUpdate
public int executeUpdate(java.lang.String sql, java.lang.String[] columnNames)Execute update.- 参数:
sql- the sqlcolumnNames- the column names- 返回:
- the int
- 另请参阅:
Statement
-
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)
-