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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addBatch(java.lang.String sql)
Adds the batch.
|
void |
cancel()
Cancel.
|
void |
clearBatch()
Clear batch.
|
void |
clearWarnings()
Clear warnings.
|
void |
close()
Close.
|
boolean |
execute(java.lang.String sql)
Execute.
|
boolean |
execute(java.lang.String sql,
int autoGeneratedKeys)
Execute.
|
boolean |
execute(java.lang.String sql,
int[] columnIndexes)
Execute.
|
boolean |
execute(java.lang.String sql,
java.lang.String[] columnNames)
Execute.
|
int[] |
executeBatch()
Execute batch.
|
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Execute query.
|
int |
executeUpdate(java.lang.String sql)
Execute update.
|
int |
executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
Execute update.
|
int |
executeUpdate(java.lang.String sql,
int[] columnIndexes)
Execute update.
|
int |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
Execute update.
|
ConnectionWrapper |
getConnection()
Gets the connection.
|
int |
getFetchDirection()
Gets the fetch direction.
|
int |
getFetchSize()
Gets the fetch size.
|
java.sql.ResultSet |
getGeneratedKeys()
Gets the generated keys.
|
int |
getMaxFieldSize()
Gets the max field size.
|
int |
getMaxRows()
Gets the max rows.
|
boolean |
getMoreResults()
Gets the more results.
|
boolean |
getMoreResults(int current)
Gets the more results.
|
int |
getQueryTimeout()
Gets the query timeout.
|
java.sql.ResultSet |
getResultSet()
Gets the result set.
|
int |
getResultSetConcurrency()
Gets the result set concurrency.
|
int |
getResultSetHoldability()
Gets the result set holdability.
|
int |
getResultSetType()
Gets the result set type.
|
java.sql.Statement |
getStatement()
Gets the statement.
|
int |
getUpdateCount()
Gets the update count.
|
java.sql.SQLWarning |
getWarnings()
Gets the warnings.
|
boolean |
isClosed()
Checks if is closed.
|
boolean |
isPoolable()
Checks if is poolable.
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
Checks if is wrapper for.
|
void |
setCursorName(java.lang.String name)
Sets the cursor name.
|
void |
setEscapeProcessing(boolean enable)
Sets the escape processing.
|
void |
setFetchDirection(int direction)
Sets the fetch direction.
|
void |
setFetchSize(int rows)
Sets the fetch size.
|
void |
setMaxFieldSize(int max)
Sets the max field size.
|
void |
setMaxRows(int max)
Sets the max rows.
|
void |
setPoolable(boolean poolable)
Sets the poolable.
|
void |
setQueryTimeout(int seconds)
Sets the query timeout.
|
<T> T |
unwrap(java.lang.Class<T> iface)
Unwrap.
|
public StatementWrapper(java.sql.Statement statement,
ConnectionWrapper connectionWrapper)
statement - the statementconnectionWrapper - the connection wrapperpublic void addBatch(java.lang.String sql)
sql - the sqlStatement.addBatch(String)public void cancel()
Statement.cancel()public void clearBatch()
Statement.clearBatch()public void clearWarnings()
Statement.clearWarnings()public void close()
close 在接口中 java.lang.AutoCloseableStatement.close()public boolean execute(java.lang.String sql)
sql - the sqlStatementpublic boolean execute(java.lang.String sql,
int autoGeneratedKeys)
sql - the sqlautoGeneratedKeys - the auto generated keysStatementpublic boolean execute(java.lang.String sql,
int[] columnIndexes)
sql - the sqlcolumnIndexes - the column indexesStatementpublic boolean execute(java.lang.String sql,
java.lang.String[] columnNames)
sql - the sqlcolumnNames - the column namesStatementpublic int[] executeBatch()
Statementpublic java.sql.ResultSet executeQuery(java.lang.String sql)
sql - the sqlStatementpublic int executeUpdate(java.lang.String sql)
sql - the sqlStatementpublic int executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
sql - the sqlautoGeneratedKeys - the auto generated keysStatementpublic int executeUpdate(java.lang.String sql,
int[] columnIndexes)
sql - the sqlcolumnIndexes - the column indexesStatementpublic int executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
sql - the sqlcolumnNames - the column namesStatementpublic ConnectionWrapper getConnection()
Statementpublic int getFetchDirection()
Statementpublic int getFetchSize()
Statementpublic java.sql.ResultSet getGeneratedKeys()
Statementpublic int getMaxFieldSize()
Statementpublic int getMaxRows()
Statementpublic boolean getMoreResults()
Statementpublic boolean getMoreResults(int current)
current - the currentStatementpublic int getQueryTimeout()
Statementpublic java.sql.ResultSet getResultSet()
Statementpublic int getResultSetConcurrency()
Statementpublic int getResultSetHoldability()
Statementpublic int getResultSetType()
Statementpublic int getUpdateCount()
Statementpublic java.sql.SQLWarning getWarnings()
Statementpublic boolean isClosed()
Statementpublic boolean isPoolable()
Statementpublic void setCursorName(java.lang.String name)
name - the new cursor nameStatementpublic void setEscapeProcessing(boolean enable)
enable - the new escape processingStatementpublic void setFetchDirection(int direction)
direction - the new fetch directionStatementpublic void setFetchSize(int rows)
rows - the new fetch sizeStatementpublic void setMaxFieldSize(int max)
max - the new max field sizeStatementpublic void setMaxRows(int max)
max - the new max rowsStatementpublic void setPoolable(boolean poolable)
poolable - the new poolableStatementpublic void setQueryTimeout(int seconds)
seconds - the new query timeoutStatementpublic boolean isWrapperFor(java.lang.Class<?> iface)
iface - the ifaceStatementpublic <T> T unwrap(java.lang.Class<T> iface)
T - the generic typeiface - the ifaceStatementpublic java.sql.Statement getStatement()