public 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 and 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 and Description |
|---|---|
void |
addBatch(String sql) |
void |
cancel() |
void |
clearBatch() |
void |
clearWarnings() |
void |
close() |
void |
closeOnCompletion() |
boolean |
execute(String sql)
Execute an update or query.
|
boolean |
execute(String sql,
int autoGeneratedKeys) |
boolean |
execute(String sql,
int[] columnIndexes) |
boolean |
execute(String sql,
String[] columnNames) |
int[] |
executeBatch()
Send a batch of statements to the database.
|
long[] |
executeLargeBatch() |
long |
executeLargeUpdate(String sql)
Execute a JDBC update
|
long |
executeLargeUpdate(String sql,
int autoGeneratedKeys) |
long |
executeLargeUpdate(String sql,
int[] columnIndexes) |
long |
executeLargeUpdate(String sql,
String[] columnNames) |
ResultSet |
executeQuery(String sql)
Execute a result set query
|
int |
executeUpdate(String sql)
Execute a JDBC update
|
int |
executeUpdate(String sql,
int autoGeneratedKeys) |
int |
executeUpdate(String sql,
int[] columnIndexes) |
int |
executeUpdate(String sql,
String[] columnNames) |
Connection |
getConnection()
Return the statement's connection
|
int |
getFetchDirection() |
int |
getFetchSize() |
ResultSet |
getGeneratedKeys() |
long |
getLargeMaxRows() |
long |
getLargeUpdateCount() |
int |
getMaxFieldSize() |
int |
getMaxRows() |
boolean |
getMoreResults()
Check for more results in the TDS stream
|
boolean |
getMoreResults(int mode) |
int |
getQueryTimeout() |
String |
getResponseBuffering()
Retrieves the response buffering mode for this SQLServerStatement object.
|
ResultSet |
getResultSet() |
int |
getResultSetConcurrency() |
int |
getResultSetHoldability() |
int |
getResultSetType() |
int |
getUpdateCount() |
SQLWarning |
getWarnings() |
boolean |
isClosed() |
boolean |
isCloseOnCompletion() |
boolean |
isPoolable() |
boolean |
isWrapperFor(Class<?> iface) |
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()
The statement's id for logging info
|
<T> T |
unwrap(Class<T> iface) |
protected SQLServerStatementColumnEncryptionSetting stmtColumnEncriptionSetting
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
executeQuery in interface Statementsql - the SQL querySQLServerException - The SQL was invalid.public int executeUpdate(String sql) throws SQLServerException
executeUpdate in interface Statementsql - the SQL querySQLServerException - The SQL was invalid.public long executeLargeUpdate(String sql) throws SQLServerException
executeLargeUpdate in interface Statementsql - the SQL querySQLServerException - The SQL was invalid.public boolean execute(String sql) throws SQLServerException
execute in interface Statementsql - The update or query.SQLServerException - The SQL statement was not valid.public 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 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
executeBatch in interface StatementSQLServerExceptionBatchUpdateExceptionpublic long[] executeLargeBatch()
throws SQLServerException,
BatchUpdateException
executeLargeBatch in interface StatementSQLServerExceptionBatchUpdateExceptionpublic 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
execute in interface StatementSQLServerExceptionpublic final boolean execute(String sql, int[] columnIndexes) throws SQLServerException
execute in interface StatementSQLServerExceptionpublic final boolean execute(String sql, String[] columnNames) throws SQLServerException
execute in interface StatementSQLServerExceptionpublic final int executeUpdate(String sql, int autoGeneratedKeys) throws SQLServerException
executeUpdate in interface StatementSQLServerExceptionpublic final long executeLargeUpdate(String sql, int autoGeneratedKeys) throws SQLServerException
executeLargeUpdate in interface StatementSQLServerExceptionpublic final int executeUpdate(String sql, int[] columnIndexes) throws SQLServerException
executeUpdate in interface StatementSQLServerExceptionpublic final long executeLargeUpdate(String sql, int[] columnIndexes) throws SQLServerException
executeLargeUpdate in interface StatementSQLServerExceptionpublic final int executeUpdate(String sql, String[] columnNames) throws SQLServerException
executeUpdate in interface StatementSQLServerExceptionpublic final long executeLargeUpdate(String sql, String[] columnNames) throws SQLServerException
executeLargeUpdate in interface StatementSQLServerExceptionpublic final ResultSet getGeneratedKeys() throws SQLServerException
getGeneratedKeys in interface StatementSQLServerExceptionpublic final boolean getMoreResults(int mode)
throws SQLServerException
getMoreResults in interface StatementSQLServerExceptionpublic 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.