ISQLServerStatement, java.lang.AutoCloseable, java.sql.Statement, java.sql.WrapperSQLServerPreparedStatementpublic class SQLServerStatement extends java.lang.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 |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addBatch(java.lang.String sql) |
|
void |
cancel() |
|
void |
clearBatch() |
|
void |
clearWarnings() |
|
void |
close() |
|
void |
closeOnCompletion() |
|
boolean |
execute(java.lang.String sql) |
Execute an update or query.
|
boolean |
execute(java.lang.String sql,
int autoGeneratedKeys) |
|
boolean |
execute(java.lang.String sql,
int[] columnIndexes) |
|
boolean |
execute(java.lang.String sql,
java.lang.String[] columnNames) |
|
int[] |
executeBatch() |
Send a batch of statements to the database.
|
long[] |
executeLargeBatch() |
|
long |
executeLargeUpdate(java.lang.String sql) |
Execute a JDBC update
|
long |
executeLargeUpdate(java.lang.String sql,
int autoGeneratedKeys) |
|
long |
executeLargeUpdate(java.lang.String sql,
int[] columnIndexes) |
|
long |
executeLargeUpdate(java.lang.String sql,
java.lang.String[] columnNames) |
|
java.sql.ResultSet |
executeQuery(java.lang.String sql) |
Execute a result set query
|
int |
executeUpdate(java.lang.String sql) |
Execute a JDBC update
|
int |
executeUpdate(java.lang.String sql,
int autoGeneratedKeys) |
|
int |
executeUpdate(java.lang.String sql,
int[] columnIndexes) |
|
int |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames) |
|
int |
getCancelQueryTimeout() |
|
java.sql.Connection |
getConnection() |
Return the statement's connection
|
int |
getFetchDirection() |
|
int |
getFetchSize() |
|
java.sql.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() |
|
java.lang.String |
getResponseBuffering() |
Retrieves the response buffering mode for this SQLServerStatement object.
|
java.sql.ResultSet |
getResultSet() |
|
int |
getResultSetConcurrency() |
|
int |
getResultSetHoldability() |
|
int |
getResultSetType() |
|
int |
getUpdateCount() |
|
java.sql.SQLWarning |
getWarnings() |
|
boolean |
isClosed() |
|
boolean |
isCloseOnCompletion() |
|
boolean |
isPoolable() |
|
boolean |
isWrapperFor(java.lang.Class<?> iface) |
|
void |
setCancelQueryTimeout(int seconds) |
|
void |
setCursorName(java.lang.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(java.lang.String value) |
Sets the response buffering mode for this SQLServerStatement object to case-insensitive String full or adaptive.
|
java.lang.String |
toString() |
The statement's id for logging info
|
<T> T |
unwrap(java.lang.Class<T> iface) |
protected SQLServerStatementColumnEncryptionSetting stmtColumnEncriptionSetting
public java.lang.String toString()
toString in class java.lang.Objectpublic void close()
throws SQLServerException
close in interface java.lang.AutoCloseableclose in interface java.sql.StatementSQLServerExceptionpublic void closeOnCompletion()
throws java.sql.SQLException
closeOnCompletion in interface java.sql.Statementjava.sql.SQLExceptionpublic java.sql.ResultSet executeQuery(java.lang.String sql)
throws SQLServerException,
java.sql.SQLTimeoutException
executeQuery in interface java.sql.Statementsql - the SQL querySQLServerException - The SQL was invalid.java.sql.SQLTimeoutExceptionpublic int executeUpdate(java.lang.String sql)
throws SQLServerException,
java.sql.SQLTimeoutException
executeUpdate in interface java.sql.Statementsql - the SQL querySQLServerException - The SQL was invalid.java.sql.SQLTimeoutExceptionpublic long executeLargeUpdate(java.lang.String sql)
throws SQLServerException,
java.sql.SQLTimeoutException
executeLargeUpdate in interface java.sql.Statementsql - the SQL querySQLServerException - The SQL was invalid.java.sql.SQLTimeoutExceptionpublic boolean execute(java.lang.String sql)
throws SQLServerException,
java.sql.SQLTimeoutException
execute in interface java.sql.Statementsql - The update or query.SQLServerException - The SQL statement was not valid.java.sql.SQLTimeoutExceptionpublic final int getMaxFieldSize()
throws SQLServerException
getMaxFieldSize in interface java.sql.StatementSQLServerExceptionpublic final void setMaxFieldSize(int max)
throws SQLServerException
setMaxFieldSize in interface java.sql.StatementSQLServerExceptionpublic final int getMaxRows()
throws SQLServerException
getMaxRows in interface java.sql.StatementSQLServerExceptionpublic final long getLargeMaxRows()
throws SQLServerException
getLargeMaxRows in interface java.sql.StatementSQLServerExceptionpublic final void setMaxRows(int max)
throws SQLServerException
setMaxRows in interface java.sql.StatementSQLServerExceptionpublic final void setLargeMaxRows(long max)
throws SQLServerException
setLargeMaxRows in interface java.sql.StatementSQLServerExceptionpublic final void setEscapeProcessing(boolean enable)
throws SQLServerException
setEscapeProcessing in interface java.sql.StatementSQLServerExceptionpublic final int getQueryTimeout()
throws SQLServerException
getQueryTimeout in interface java.sql.StatementSQLServerExceptionpublic final void setQueryTimeout(int seconds)
throws SQLServerException
setQueryTimeout in interface java.sql.StatementSQLServerExceptionpublic final int getCancelQueryTimeout()
throws SQLServerException
SQLServerExceptionpublic final void setCancelQueryTimeout(int seconds)
throws SQLServerException
SQLServerExceptionpublic final void cancel()
throws SQLServerException
cancel in interface java.sql.StatementSQLServerExceptionpublic final java.sql.SQLWarning getWarnings()
throws SQLServerException
getWarnings in interface java.sql.StatementSQLServerExceptionpublic final void clearWarnings()
throws SQLServerException
clearWarnings in interface java.sql.StatementSQLServerExceptionpublic final void setCursorName(java.lang.String name)
throws SQLServerException
setCursorName in interface java.sql.StatementSQLServerExceptionpublic final java.sql.ResultSet getResultSet()
throws SQLServerException
getResultSet in interface java.sql.StatementSQLServerExceptionpublic final int getUpdateCount()
throws SQLServerException
getUpdateCount in interface java.sql.StatementSQLServerExceptionpublic final long getLargeUpdateCount()
throws SQLServerException
getLargeUpdateCount in interface java.sql.StatementSQLServerExceptionpublic final boolean getMoreResults()
throws SQLServerException
getMoreResults in interface java.sql.StatementSQLServerExceptionpublic final void setFetchDirection(int nDir)
throws SQLServerException
setFetchDirection in interface java.sql.StatementSQLServerExceptionpublic final int getFetchDirection()
throws SQLServerException
getFetchDirection in interface java.sql.StatementSQLServerExceptionpublic final void setFetchSize(int rows)
throws SQLServerException
setFetchSize in interface java.sql.StatementSQLServerExceptionpublic final int getFetchSize()
throws SQLServerException
getFetchSize in interface java.sql.StatementSQLServerExceptionpublic final int getResultSetConcurrency()
throws SQLServerException
getResultSetConcurrency in interface java.sql.StatementSQLServerExceptionpublic final int getResultSetType()
throws SQLServerException
getResultSetType in interface java.sql.StatementSQLServerExceptionpublic void addBatch(java.lang.String sql)
throws SQLServerException
addBatch in interface java.sql.StatementSQLServerExceptionpublic void clearBatch()
throws SQLServerException
clearBatch in interface java.sql.StatementSQLServerExceptionpublic int[] executeBatch()
throws SQLServerException,
java.sql.BatchUpdateException,
java.sql.SQLTimeoutException
executeBatch in interface java.sql.StatementSQLServerExceptionjava.sql.BatchUpdateExceptionjava.sql.SQLTimeoutExceptionpublic long[] executeLargeBatch()
throws SQLServerException,
java.sql.BatchUpdateException,
java.sql.SQLTimeoutException
executeLargeBatch in interface java.sql.StatementSQLServerExceptionjava.sql.BatchUpdateExceptionjava.sql.SQLTimeoutExceptionpublic final java.sql.Connection getConnection()
throws SQLServerException
getConnection in interface java.sql.StatementSQLServerException - when an error occurspublic final int getResultSetHoldability()
throws java.sql.SQLException
getResultSetHoldability in interface java.sql.Statementjava.sql.SQLExceptionpublic final boolean execute(java.lang.String sql,
int autoGeneratedKeys)
throws SQLServerException,
java.sql.SQLTimeoutException
execute in interface java.sql.StatementSQLServerExceptionjava.sql.SQLTimeoutExceptionpublic final boolean execute(java.lang.String sql,
int[] columnIndexes)
throws SQLServerException,
java.sql.SQLTimeoutException
execute in interface java.sql.StatementSQLServerExceptionjava.sql.SQLTimeoutExceptionpublic final boolean execute(java.lang.String sql,
java.lang.String[] columnNames)
throws SQLServerException,
java.sql.SQLTimeoutException
execute in interface java.sql.StatementSQLServerExceptionjava.sql.SQLTimeoutExceptionpublic final int executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
throws SQLServerException,
java.sql.SQLTimeoutException
executeUpdate in interface java.sql.StatementSQLServerExceptionjava.sql.SQLTimeoutExceptionpublic final long executeLargeUpdate(java.lang.String sql,
int autoGeneratedKeys)
throws SQLServerException,
java.sql.SQLTimeoutException
executeLargeUpdate in interface java.sql.StatementSQLServerExceptionjava.sql.SQLTimeoutExceptionpublic final int executeUpdate(java.lang.String sql,
int[] columnIndexes)
throws SQLServerException,
java.sql.SQLTimeoutException
executeUpdate in interface java.sql.StatementSQLServerExceptionjava.sql.SQLTimeoutExceptionpublic final long executeLargeUpdate(java.lang.String sql,
int[] columnIndexes)
throws SQLServerException,
java.sql.SQLTimeoutException
executeLargeUpdate in interface java.sql.StatementSQLServerExceptionjava.sql.SQLTimeoutExceptionpublic final int executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
throws SQLServerException,
java.sql.SQLTimeoutException
executeUpdate in interface java.sql.StatementSQLServerExceptionjava.sql.SQLTimeoutExceptionpublic final long executeLargeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
throws SQLServerException,
java.sql.SQLTimeoutException
executeLargeUpdate in interface java.sql.StatementSQLServerExceptionjava.sql.SQLTimeoutExceptionpublic final java.sql.ResultSet getGeneratedKeys()
throws SQLServerException
getGeneratedKeys in interface java.sql.StatementSQLServerExceptionpublic final boolean getMoreResults(int mode)
throws SQLServerException
getMoreResults in interface java.sql.StatementSQLServerExceptionpublic boolean isClosed()
throws java.sql.SQLException
isClosed in interface java.sql.Statementjava.sql.SQLExceptionpublic boolean isCloseOnCompletion()
throws java.sql.SQLException
isCloseOnCompletion in interface java.sql.Statementjava.sql.SQLExceptionpublic boolean isPoolable()
throws java.sql.SQLException
isPoolable in interface java.sql.Statementjava.sql.SQLExceptionpublic void setPoolable(boolean poolable)
throws java.sql.SQLException
setPoolable in interface java.sql.Statementjava.sql.SQLExceptionpublic boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionpublic final void setResponseBuffering(java.lang.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 java.lang.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.