public class JdbcStatement extends TraceObject implements Statement, JdbcStatementBackwardsCompat
| 限定符和类型 | 字段和说明 |
|---|---|
protected boolean |
closedByResultSet |
protected JdbcConnection |
conn |
protected int |
fetchSize |
protected int |
maxRows |
protected JdbcResultSet |
resultSet |
protected int |
resultSetConcurrency |
protected int |
resultSetType |
protected SessionInterface |
session |
protected int |
updateCount |
ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, STATEMENT, trace, XA_DATA_SOURCE, XID| 限定符和类型 | 方法和说明 |
|---|---|
void |
addBatch(String sql)
Adds a statement to the batch.
|
void |
cancel()
Cancels a currently running statement.
|
protected boolean |
checkClosed(boolean write)
INTERNAL.
|
void |
clearBatch()
Clears the batch.
|
void |
clearWarnings()
Clears all warnings.
|
void |
close()
Closes this statement.
|
protected void |
closeOldResultSet()
INTERNAL.
|
void |
closeOnCompletion()
[Not supported]
|
boolean |
execute(String sql)
Executes an arbitrary statement.
|
boolean |
execute(String sql,
int autoGeneratedKeys)
Executes a statement and returns the update count.
|
boolean |
execute(String sql,
int[] columnIndexes)
Executes a statement and returns the update count.
|
boolean |
execute(String sql,
String[] columnNames)
Executes a statement and returns the update count.
|
int[] |
executeBatch()
Executes the batch.
|
ResultSet |
executeQuery(String sql)
Executes a query (select statement) and returns the result set.
|
int |
executeUpdate(String sql)
Executes a statement (insert, update, delete, create, drop)
and returns the update count.
|
int |
executeUpdate(String sql,
int autoGeneratedKeys)
Executes a statement and returns the update count.
|
int |
executeUpdate(String sql,
int[] columnIndexes)
Executes a statement and returns the update count.
|
int |
executeUpdate(String sql,
String[] columnNames)
Executes a statement and returns the update count.
|
Connection |
getConnection()
Returns the connection that created this object.
|
int |
getFetchDirection()
Gets the fetch direction.
|
int |
getFetchSize()
Gets the number of rows suggested to read in one step.
|
ResultSet |
getGeneratedKeys()
Return a result set that contains the last generated auto-increment key
for this connection, if there was one.
|
int |
getLastExecutedCommandType()
INTERNAL.
|
int |
getMaxFieldSize()
Gets the maximum number of bytes for a result set column.
|
int |
getMaxRows()
Gets the maximum number of rows for a ResultSet.
|
boolean |
getMoreResults()
Moves to the next result set - however there is always only one result
set.
|
boolean |
getMoreResults(int current)
Move to the next result set.
|
int |
getQueryTimeout()
Gets the current query timeout in seconds.
|
ResultSet |
getResultSet()
Returns the last result set produces by this statement.
|
int |
getResultSetConcurrency()
Gets the result set concurrency created by this object.
|
int |
getResultSetHoldability()
Gets the result set holdability.
|
int |
getResultSetType()
Gets the result set type.
|
int |
getUpdateCount()
Returns the last update count of this statement.
|
SQLWarning |
getWarnings()
Gets the first warning reported by calls on this object.
|
boolean |
isClosed()
Returns whether this statement is closed.
|
boolean |
isCloseOnCompletion()
[Not supported]
|
boolean |
isPoolable()
Returns whether this object is poolable.
|
boolean |
isWrapperFor(Class<?> iface)
Checks if unwrap can return an object of this class.
|
void |
setCursorName(String name)
Sets the name of the cursor.
|
void |
setEscapeProcessing(boolean enable)
Enables or disables processing or JDBC escape syntax.
|
protected void |
setExecutingStatement(CommandInterface c)
INTERNAL.
|
void |
setFetchDirection(int direction)
Sets the fetch direction.
|
void |
setFetchSize(int rows)
Sets the number of rows suggested to read in one step.
|
void |
setMaxFieldSize(int max)
Sets the maximum number of bytes for a result set column.
|
void |
setMaxRows(int maxRows)
Gets the maximum number of rows for a ResultSet.
|
void |
setPoolable(boolean poolable)
Requests that this object should be pooled or not.
|
void |
setQueryTimeout(int seconds)
Sets the current query timeout in seconds.
|
String |
toString()
INTERNAL
|
<T> T |
unwrap(Class<T> iface)
Return an object of this class if possible.
|
boolean |
wasCancelled()
Check whether the statement was cancelled.
|
debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupportedprotected JdbcConnection conn
protected SessionInterface session
protected JdbcResultSet resultSet
protected int maxRows
protected int fetchSize
protected int updateCount
protected final int resultSetType
protected final int resultSetConcurrency
protected final boolean closedByResultSet
public ResultSet executeQuery(String sql) throws SQLException
executeQuery 在接口中 Statementsql - the SQL statement to executeSQLExceptionpublic int executeUpdate(String sql) throws SQLException
executeUpdate 在接口中 Statementsql - the SQL statementSQLException - if a database error occurred or a
select statement was executedpublic boolean execute(String sql) throws SQLException
execute 在接口中 Statementsql - the SQL statement to executeSQLExceptionpublic ResultSet getResultSet() throws SQLException
getResultSet 在接口中 StatementSQLExceptionpublic int getUpdateCount()
throws SQLException
getUpdateCount 在接口中 StatementSQLException - if this object is closed or invalidpublic void close()
throws SQLException
close 在接口中 AutoCloseableclose 在接口中 StatementSQLExceptionpublic Connection getConnection()
getConnection 在接口中 Statementpublic SQLWarning getWarnings() throws SQLException
getWarnings 在接口中 StatementSQLExceptionpublic void clearWarnings()
throws SQLException
clearWarnings 在接口中 StatementSQLExceptionpublic void setCursorName(String name) throws SQLException
setCursorName 在接口中 Statementname - ignoredSQLException - if this object is closedpublic void setFetchDirection(int direction)
throws SQLException
setFetchDirection 在接口中 Statementdirection - ignoredSQLException - if this object is closedpublic int getFetchDirection()
throws SQLException
getFetchDirection 在接口中 StatementSQLException - if this object is closedpublic int getMaxRows()
throws SQLException
getMaxRows 在接口中 StatementSQLException - if this object is closedpublic void setMaxRows(int maxRows)
throws SQLException
setMaxRows 在接口中 StatementmaxRows - the number of rows where 0 means no limitSQLException - if this object is closedpublic void setFetchSize(int rows)
throws SQLException
setFetchSize 在接口中 Statementrows - the number of rowsSQLException - if this object is closedpublic int getFetchSize()
throws SQLException
getFetchSize 在接口中 StatementSQLException - if this object is closedpublic int getResultSetConcurrency()
throws SQLException
getResultSetConcurrency 在接口中 StatementSQLExceptionpublic int getResultSetType()
throws SQLException
getResultSetType 在接口中 StatementSQLException - if this object is closedpublic int getMaxFieldSize()
throws SQLException
getMaxFieldSize 在接口中 StatementSQLException - if this object is closedpublic void setMaxFieldSize(int max)
throws SQLException
setMaxFieldSize 在接口中 Statementmax - the maximum size - ignoredSQLException - if this object is closedpublic void setEscapeProcessing(boolean enable)
throws SQLException
setEscapeProcessing 在接口中 Statementenable - - true (default) or false (no conversion is attempted)SQLException - if this object is closedpublic void cancel()
throws SQLException
cancel 在接口中 StatementSQLException - if this object is closedpublic boolean wasCancelled()
public int getQueryTimeout()
throws SQLException
getQueryTimeout 在接口中 StatementSQLException - if this object is closedpublic void setQueryTimeout(int seconds)
throws SQLException
setQueryTimeout 在接口中 Statementseconds - the timeout in seconds - 0 means no timeout, values
smaller 0 will throw an exceptionSQLException - if this object is closedpublic void addBatch(String sql) throws SQLException
addBatch 在接口中 Statementsql - the SQL statementSQLExceptionpublic void clearBatch()
throws SQLException
clearBatch 在接口中 StatementSQLExceptionpublic int[] executeBatch()
throws SQLException
executeBatch 在接口中 StatementSQLExceptionpublic ResultSet getGeneratedKeys() throws SQLException
getGeneratedKeys 在接口中 StatementSQLException - if this object is closedpublic boolean getMoreResults()
throws SQLException
getMoreResults 在接口中 StatementSQLException - if this object is closed.public boolean getMoreResults(int current)
throws SQLException
getMoreResults 在接口中 Statementcurrent - Statement.CLOSE_CURRENT_RESULT,
Statement.KEEP_CURRENT_RESULT,
or Statement.CLOSE_ALL_RESULTSSQLExceptionpublic int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
executeUpdate 在接口中 Statementsql - the SQL statementautoGeneratedKeys - ignoredSQLException - if a database error occurred or a
select statement was executedpublic int executeUpdate(String sql, int[] columnIndexes) throws SQLException
executeUpdate 在接口中 Statementsql - the SQL statementcolumnIndexes - ignoredSQLException - if a database error occurred or a
select statement was executedpublic int executeUpdate(String sql, String[] columnNames) throws SQLException
executeUpdate 在接口中 Statementsql - the SQL statementcolumnNames - ignoredSQLException - if a database error occurred or a
select statement was executedpublic boolean execute(String sql, int autoGeneratedKeys) throws SQLException
execute 在接口中 Statementsql - the SQL statementautoGeneratedKeys - ignoredSQLException - if a database error occurred or a
select statement was executedpublic boolean execute(String sql, int[] columnIndexes) throws SQLException
execute 在接口中 Statementsql - the SQL statementcolumnIndexes - ignoredSQLException - if a database error occurred or a
select statement was executedpublic boolean execute(String sql, String[] columnNames) throws SQLException
execute 在接口中 Statementsql - the SQL statementcolumnNames - ignoredSQLException - if a database error occurred or a
select statement was executedpublic int getResultSetHoldability()
throws SQLException
getResultSetHoldability 在接口中 StatementSQLExceptionpublic void closeOnCompletion()
closeOnCompletion 在接口中 Statementpublic boolean isCloseOnCompletion()
isCloseOnCompletion 在接口中 Statementprotected boolean checkClosed(boolean write)
write - if the next operation is possibly writingDbException - if it is closedprotected void closeOldResultSet()
throws SQLException
SQLExceptionprotected void setExecutingStatement(CommandInterface c)
c - the commandpublic int getLastExecutedCommandType()
public boolean isClosed()
throws SQLException
isClosed 在接口中 StatementSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap 在接口中 Wrapperiface - the classSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor 在接口中 Wrapperiface - the classSQLExceptionpublic boolean isPoolable()
isPoolable 在接口中 Statementpublic void setPoolable(boolean poolable)
setPoolable 在接口中 Statementpoolable - the requested valueCopyright © 2017. All rights reserved.