ISQLServerStatement, AutoCloseable, Statement, WrapperSQLServerPreparedStatementpublic class SQLServerStatement extends Object implements ISQLServerStatement
Implementation Notes
Fetching Result sets
The queries first rowset is available immediately after the executeQuery. The first rs.next() does not make a server round trip. For non server side resultsets the entire result set is in the rowset. For server side result sets the number of rows in the rowset is set with nFetchSize
The API javadoc for JDBC API methods that this class implements are not repeated here. Please see Sun's JDBC API interfaces javadoc for those details.
| Modifier and Type | Field | Description |
|---|---|---|
protected SQLServerStatementColumnEncryptionSetting |
stmtColumnEncriptionSetting |
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO| Modifier and Type | Method | Description |
|---|---|---|
void |
addBatch(String sql) |
|
void |
cancel() |
|
void |
clearBatch() |
|
void |
clearWarnings() |
|
void |
close() |
|
void |
closeOnCompletion() |
|
boolean |
execute(String sql) |
|
boolean |
execute(String sql,
int autoGeneratedKeys) |
|
boolean |
execute(String sql,
int[] columnIndexes) |
|
boolean |
execute(String sql,
String[] columnNames) |
|
int[] |
executeBatch() |
Sends a batch of statements to the database.
|
long[] |
executeLargeBatch() |
|
long |
executeLargeUpdate(String sql) |
|
long |
executeLargeUpdate(String sql,
int autoGeneratedKeys) |
|
long |
executeLargeUpdate(String sql,
int[] columnIndexes) |
|
long |
executeLargeUpdate(String sql,
String[] columnNames) |
|
ResultSet |
executeQuery(String sql) |
|
int |
executeUpdate(String sql) |
|
int |
executeUpdate(String sql,
int autoGeneratedKeys) |
|
int |
executeUpdate(String sql,
int[] columnIndexes) |
|
int |
executeUpdate(String sql,
String[] columnNames) |
|
int |
getCancelQueryTimeout() |
Returns the
cancelQueryTimeout property set on this SQLServerStatement object. |
Connection |
getConnection() |
Returns the statement's connection.
|
int |
getFetchDirection() |
|
int |
getFetchSize() |
|
ResultSet |
getGeneratedKeys() |
|
long |
getLargeMaxRows() |
|
long |
getLargeUpdateCount() |
|
int |
getMaxFieldSize() |
|
int |
getMaxRows() |
|
boolean |
getMoreResults() |
Returns more results in the TDS stream.
|
boolean |
getMoreResults(int mode) |
|
int |
getQueryTimeout() |
|
String |
getResponseBuffering() |
Returns the response buffering mode for this SQLServerStatement object.
|
ResultSet |
getResultSet() |
|
int |
getResultSetConcurrency() |
|
int |
getResultSetHoldability() |
|
int |
getResultSetType() |
|
protected SQLServerStatementColumnEncryptionSetting |
getStmtColumnEncriptionSetting() |
|
int |
getUpdateCount() |
|
SQLWarning |
getWarnings() |
|
boolean |
isClosed() |
|
boolean |
isCloseOnCompletion() |
|
boolean |
isPoolable() |
|
boolean |
isWrapperFor(Class<?> iface) |
|
void |
setCancelQueryTimeout(int seconds) |
Sets the
cancelQueryTimeout property on this SQLServerStatement object to cancel
queryTimeout set on Connection or Statement level. |
void |
setCursorName(String name) |
|
void |
setEscapeProcessing(boolean enable) |
|
void |
setFetchDirection(int nDir) |
|
void |
setFetchSize(int rows) |
|
void |
setLargeMaxRows(long max) |
|
void |
setMaxFieldSize(int max) |
|
void |
setMaxRows(int max) |
|
void |
setPoolable(boolean poolable) |
|
void |
setQueryTimeout(int seconds) |
|
void |
setResponseBuffering(String value) |
Sets the response buffering mode for this SQLServerStatement object to case-insensitive String full or adaptive.
|
String |
toString() |
Returns the statement's id for logging info
|
<T> T |
unwrap(Class<T> iface) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitenquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, isSimpleIdentifierprotected SQLServerStatementColumnEncryptionSetting stmtColumnEncriptionSetting
protected SQLServerStatementColumnEncryptionSetting getStmtColumnEncriptionSetting()
public String toString()
public void close()
throws SQLServerException
close in interface AutoCloseableclose in interface StatementSQLServerExceptionpublic void closeOnCompletion()
throws SQLException
closeOnCompletion in interface StatementSQLExceptionpublic ResultSet executeQuery(String sql) throws SQLServerException, SQLTimeoutException
executeQuery in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic int executeUpdate(String sql) throws SQLServerException, SQLTimeoutException
executeUpdate in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic long executeLargeUpdate(String sql) throws SQLServerException, SQLTimeoutException
executeLargeUpdate in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic boolean execute(String sql) throws SQLServerException, SQLTimeoutException
execute in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic final int getMaxFieldSize()
throws SQLServerException
getMaxFieldSize in interface StatementSQLServerExceptionpublic final void setMaxFieldSize(int max)
throws SQLServerException
setMaxFieldSize in interface StatementSQLServerExceptionpublic final int getMaxRows()
throws SQLServerException
getMaxRows in interface StatementSQLServerExceptionpublic final long getLargeMaxRows()
throws SQLServerException
getLargeMaxRows in interface StatementSQLServerExceptionpublic final void setMaxRows(int max)
throws SQLServerException
setMaxRows in interface StatementSQLServerExceptionpublic final void setLargeMaxRows(long max)
throws SQLServerException
setLargeMaxRows in interface StatementSQLServerExceptionpublic final void setEscapeProcessing(boolean enable)
throws SQLServerException
setEscapeProcessing in interface StatementSQLServerExceptionpublic final int getQueryTimeout()
throws SQLServerException
getQueryTimeout in interface StatementSQLServerExceptionpublic final void setQueryTimeout(int seconds)
throws SQLServerException
setQueryTimeout in interface StatementSQLServerExceptionpublic final int getCancelQueryTimeout()
throws SQLServerException
ISQLServerStatementcancelQueryTimeout property set on this SQLServerStatement object.getCancelQueryTimeout in interface ISQLServerStatementSQLServerException - if any error occurspublic final void setCancelQueryTimeout(int seconds)
throws SQLServerException
ISQLServerStatementcancelQueryTimeout property on this SQLServerStatement object to cancel
queryTimeout set on Connection or Statement level.setCancelQueryTimeout in interface ISQLServerStatementseconds - Time duration in seconds.SQLServerException - if any error occurspublic final void cancel()
throws SQLServerException
cancel in interface StatementSQLServerExceptionpublic final SQLWarning getWarnings() throws SQLServerException
getWarnings in interface StatementSQLServerExceptionpublic final void clearWarnings()
throws SQLServerException
clearWarnings in interface StatementSQLServerExceptionpublic final void setCursorName(String name) throws SQLServerException
setCursorName in interface StatementSQLServerExceptionpublic final ResultSet getResultSet() throws SQLServerException
getResultSet in interface StatementSQLServerExceptionpublic final int getUpdateCount()
throws SQLServerException
getUpdateCount in interface StatementSQLServerExceptionpublic final long getLargeUpdateCount()
throws SQLServerException
getLargeUpdateCount in interface StatementSQLServerExceptionpublic final boolean getMoreResults()
throws SQLServerException
getMoreResults in interface StatementSQLServerExceptionpublic final void setFetchDirection(int nDir)
throws SQLServerException
setFetchDirection in interface StatementSQLServerExceptionpublic final int getFetchDirection()
throws SQLServerException
getFetchDirection in interface StatementSQLServerExceptionpublic final void setFetchSize(int rows)
throws SQLServerException
setFetchSize in interface StatementSQLServerExceptionpublic final int getFetchSize()
throws SQLServerException
getFetchSize in interface StatementSQLServerExceptionpublic final int getResultSetConcurrency()
throws SQLServerException
getResultSetConcurrency in interface StatementSQLServerExceptionpublic final int getResultSetType()
throws SQLServerException
getResultSetType in interface StatementSQLServerExceptionpublic void addBatch(String sql) throws SQLServerException
addBatch in interface StatementSQLServerExceptionpublic void clearBatch()
throws SQLServerException
clearBatch in interface StatementSQLServerExceptionpublic int[] executeBatch()
throws SQLServerException,
BatchUpdateException,
SQLTimeoutException
executeBatch in interface StatementSQLServerExceptionBatchUpdateExceptionSQLTimeoutExceptionpublic long[] executeLargeBatch()
throws SQLServerException,
BatchUpdateException,
SQLTimeoutException
executeLargeBatch in interface StatementSQLServerExceptionBatchUpdateExceptionSQLTimeoutExceptionpublic final Connection getConnection() throws SQLServerException
getConnection in interface StatementSQLServerException - when an error occurspublic final int getResultSetHoldability()
throws SQLException
getResultSetHoldability in interface StatementSQLExceptionpublic final boolean execute(String sql, int autoGeneratedKeys) throws SQLServerException, SQLTimeoutException
execute in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic final boolean execute(String sql, int[] columnIndexes) throws SQLServerException, SQLTimeoutException
execute in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic final boolean execute(String sql, String[] columnNames) throws SQLServerException, SQLTimeoutException
execute in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic final int executeUpdate(String sql, int autoGeneratedKeys) throws SQLServerException, SQLTimeoutException
executeUpdate in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic final long executeLargeUpdate(String sql, int autoGeneratedKeys) throws SQLServerException, SQLTimeoutException
executeLargeUpdate in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic final int executeUpdate(String sql, int[] columnIndexes) throws SQLServerException, SQLTimeoutException
executeUpdate in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic final long executeLargeUpdate(String sql, int[] columnIndexes) throws SQLServerException, SQLTimeoutException
executeLargeUpdate in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic final int executeUpdate(String sql, String[] columnNames) throws SQLServerException, SQLTimeoutException
executeUpdate in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic final long executeLargeUpdate(String sql, String[] columnNames) throws SQLServerException, SQLTimeoutException
executeLargeUpdate in interface StatementSQLServerExceptionSQLTimeoutExceptionpublic final ResultSet getGeneratedKeys() throws SQLServerException
getGeneratedKeys in interface StatementSQLServerExceptionpublic final boolean getMoreResults(int mode)
throws SQLException
getMoreResults in interface StatementSQLExceptionpublic boolean isClosed()
throws SQLException
isClosed in interface StatementSQLExceptionpublic boolean isCloseOnCompletion()
throws SQLException
isCloseOnCompletion in interface StatementSQLExceptionpublic boolean isPoolable()
throws SQLException
isPoolable in interface StatementSQLExceptionpublic void setPoolable(boolean poolable)
throws SQLException
setPoolable in interface StatementSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic final void setResponseBuffering(String value) throws SQLServerException
ISQLServerStatementResponse buffering controls the driver's buffering of responses from SQL Server.
Possible values are:
"full" - Fully buffer the response at execution time.
"adaptive" - Data Pipe adaptive buffering
setResponseBuffering in interface ISQLServerStatementvalue - A String that contains the response buffering mode. The valid mode can be one of the following
case-insensitive Strings: full or adaptive.SQLServerException - If there are any errors in setting the response buffering mode.public final String getResponseBuffering() throws SQLServerException
ISQLServerStatementgetResponseBuffering in interface ISQLServerStatementSQLServerException - If there are any errors in retrieving the response buffering mode.Copyright © 2018 Microsoft Corporation. All rights reserved.