| java.lang.Object com.internetcds.jdbc.tds.Statement
All known Subclasses: com.internetcds.jdbc.tds.PreparedStatement_base,
Constructor Summary | |
public | Statement(Object connection_, Tds tds_) Constructor for a Statement. |
Method Summary | |
public void | addBatch(String sql) JDBC 2.0
Adds a SQL command to the current batch of commmands for the statement. | public void | cancel() | public void | clearBatch() JDBC 2.0
Makes the set of commands in the current batch empty. | public void | clearWarnings() After this call, getWarnings returns null until a new warning
is reported for this Statement. | public void | close() In many cases, it is desirable to immediately release a
Statement's database and JDBC resources instead of waiting
for this to happen when it is automatically closed. | protected void | closeResults() | public void | commit() | public boolean | execute(String sql) | public boolean | execute(String sql, int autoGeneratedKeys) | public boolean | execute(String sql, int[] columnIndexes) | public boolean | execute(String sql, String[] columnNames) | public int[] | executeBatch() JDBC 2.0
Submits a batch of commands to the database for execution.
This method is optional.
an array of update counts containing one element for eachcommand in the batch. | public java.sql.ResultSet | executeQuery(String sql) | public int | executeUpdate(String sql) Execute a SQL INSERT, UPDATE or DELETE statement. | public int | executeUpdate(String sql, int autoGeneratedKeys) | public int | executeUpdate(String sql, int[] columnIndexes) | public int | executeUpdate(String sql, String[] columnNames) | protected void | finalize() | public java.sql.Connection | getConnection() JDBC 2.0
Returns the Connection object
that produced this Statement object. | public int | getFetchDirection() JDBC 2.0
Retrieves the direction for fetching rows from
database tables that is the default for result sets
generated from this Statement object. | public int | getFetchSize() JDBC 2.0
Retrieves the number of result set rows that is the default
fetch size for result sets
generated from this Statement object. | public ResultSet | getGeneratedKeys() | public int | getMaxFieldSize() The maxFieldSize limit (in bytes) is the maximum amount of
data returned for any column value; it only applies to
BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR and LONGVARCHAR
columns. | public int | getMaxRows() The maxRows limit is set to limit the number of rows that
any ResultSet can contain. | public boolean | getMoreResults() getMoreResults moves to a Statement's next result. | public boolean | getMoreResults(int current) | public int | getQueryTimeout() The queryTimeout limit is the number of seconds the driver
will wait for a Statement to execute. | public java.sql.ResultSet | getResultSet() getResultSet returns the current result as a ResultSet. | public int | getResultSetConcurrency() JDBC 2.0
Retrieves the result set concurrency. | public int | getResultSetHoldability() | public int | getResultSetType() JDBC 2.0
Determine the result set type. | public int | getUpdateCount() getUpdateCount returns the current result as an update count,
if the result is a ResultSet or there are no more results, -1
is returned. | public SQLWarning | getWarnings() The first warning reported by calls on this Statement is
returned. | public boolean | isClosed() | public boolean | isPoolable() | public boolean | isWrapperFor(Class> iface) | public static void | main(String args) | public void | rollback() | public void | setCursorName(String name) setCursorName defines the SQL cursor name that will be used by
subsequent execute methods. | public void | setEscapeProcessing(boolean enable) If escape scanning is on (the default), the driver will do escape
substitution before sending the SQL to the database. | public void | setFetchDirection(int direction) JDBC 2.0
Gives the driver a hint as to the direction in which
the rows in a result set
will be processed. | public void | setFetchSize(int rows) JDBC 2.0
Gives the JDBC driver a hint as to the number of rows that should
be fetched from the database when more rows are needed. | public void | setMaxFieldSize(int max) | public void | setMaxRows(int max) | public void | setPoolable(boolean poolable) | public void | setQueryTimeout(int seconds) | protected void | startResultSet() | public T | unwrap(Class<T> iface) |
timeout | protected int timeout(Code) | | |
updateCount | protected int updateCount(Code) | | |
Statement | public Statement(Object connection_, Tds tds_) throws SQLException(Code) | | Constructor for a Statement. It simply sets the connection
that created us.
Parameters: connection_ - the Connection instantation that creates us Parameters: tds_ - a TDS instance to use for communication with server. |
addBatch | public void addBatch(String sql) throws SQLException(Code) | | JDBC 2.0
Adds a SQL command to the current batch of commmands for the statement.
This method is optional.
Parameters: sql - typically this is a static SQL INSERT or UPDATE statement exception: SQLException - if a database access error occurs, or thedriver does not support batch statements |
clearBatch | public void clearBatch() throws SQLException(Code) | | JDBC 2.0
Makes the set of commands in the current batch empty.
This method is optional.
exception: SQLException - if a database access error occurs or thedriver does not support batch statements |
clearWarnings | public void clearWarnings() throws SQLException(Code) | | After this call, getWarnings returns null until a new warning
is reported for this Statement.
exception: SQLException - if a database access error occurs (why?) |
close | public void close() throws SQLException(Code) | | In many cases, it is desirable to immediately release a
Statement's database and JDBC resources instead of waiting
for this to happen when it is automatically closed. The
close method provides this immediate release.
Note: A Statement is automatically closed when it is
garbage collected. When a Statement is closed, its current
ResultSet, if one exists, is also closed.
exception: SQLException - if a database access error occurs (why?) |
execute | public boolean execute(String sql) throws SQLException(Code) | | Parameters: sql - any SQL statement true if the next result is a ResulSet, false if it isan update count or there are no more results exception: SQLException - if a database access error occurs |
executeBatch | public int[] executeBatch() throws SQLException(Code) | | JDBC 2.0
Submits a batch of commands to the database for execution.
This method is optional.
an array of update counts containing one element for eachcommand in the batch. The array is ordered accordingto the order in which commands were inserted into the batch. exception: SQLException - if a database access error occurs or thedriver does not support batch statements |
executeQuery | public java.sql.ResultSet executeQuery(String sql) throws SQLException(Code) | | Execute a SQL statement that retruns a single ResultSet
Parameters: Sql - typically a static SQL SELECT statement a ResulSet that contains the data produced by the query exception: SQLException - if a database access error occurs |
executeUpdate | public int executeUpdate(String sql) throws SQLException(Code) | | Execute a SQL INSERT, UPDATE or DELETE statement. In addition
SQL statements that return nothing such as SQL DDL statements
can be executed
Any IDs generated for AUTO_INCREMENT fields can be retrieved
by looking through the SQLWarning chain of this statement
for warnings of the form "LAST_INSERTED_ID = 'some number',
COMMAND = 'your sql'".
Parameters: Sql - a SQL statement either a row count, or 0 for SQL commands exception: SQLException - if a database access error occurs |
getConnection | public java.sql.Connection getConnection() throws SQLException(Code) | | JDBC 2.0
Returns the Connection object
that produced this Statement object.
the connection that produced this statement exception: SQLException - if a database access error occurs |
getFetchDirection | public int getFetchDirection() throws SQLException(Code) | | JDBC 2.0
Retrieves the direction for fetching rows from
database tables that is the default for result sets
generated from this Statement object.
If this Statement object has not set
a fetch direction by calling the method setFetchDirection ,
the return value is implementation-specific.
the default fetch direction for result sets generatedfrom this Statement object exception: SQLException - if a database access error occurs |
getFetchSize | public int getFetchSize() throws SQLException(Code) | | JDBC 2.0
Retrieves the number of result set rows that is the default
fetch size for result sets
generated from this Statement object.
If this Statement object has not set
a fetch size by calling the method setFetchSize ,
the return value is implementation-specific.
the default fetch size for result sets generatedfrom this Statement object exception: SQLException - if a database access error occurs |
getMaxFieldSize | public int getMaxFieldSize() throws SQLException(Code) | | The maxFieldSize limit (in bytes) is the maximum amount of
data returned for any column value; it only applies to
BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR and LONGVARCHAR
columns. If the limit is exceeded, the excess data is silently
discarded.
the current max column size limit; zero means unlimited exception: SQLException - if a database access error occurs |
getMaxRows | public int getMaxRows() throws SQLException(Code) | | The maxRows limit is set to limit the number of rows that
any ResultSet can contain. If the limit is exceeded, the
excess rows are silently dropped.
the current maximum row limit; zero means unlimited exception: SQLException - if a database access error occurs |
getMoreResults | public boolean getMoreResults() throws SQLException(Code) | | getMoreResults moves to a Statement's next result. If it returns
true, this result is a ResulSet.
true if the next ResultSet is valid exception: SQLException - if a database access error occurs |
getQueryTimeout | public int getQueryTimeout() throws SQLException(Code) | | The queryTimeout limit is the number of seconds the driver
will wait for a Statement to execute. If the limit is
exceeded, a SQLException is thrown.
the current query timeout limit in seconds; 0 = unlimited exception: SQLException - if a database access error occurs |
getResultSet | public java.sql.ResultSet getResultSet() throws SQLException(Code) | | getResultSet returns the current result as a ResultSet. It
should only be called once per result.
the current result set; null if there are no more exception: SQLException - if a database access error occurs |
getResultSetConcurrency | public int getResultSetConcurrency() throws SQLException(Code) | | JDBC 2.0
Retrieves the result set concurrency.
|
getResultSetType | public int getResultSetType() throws SQLException(Code) | | JDBC 2.0
Determine the result set type.
|
getUpdateCount | public int getUpdateCount() throws SQLException(Code) | | getUpdateCount returns the current result as an update count,
if the result is a ResultSet or there are no more results, -1
is returned. It should only be called once per result.
the current result as an update count. exception: SQLException - if a database access error occurs |
getWarnings | public SQLWarning getWarnings() throws SQLException(Code) | | The first warning reported by calls on this Statement is
returned. A Statement's execute methods clear its SQLWarning
chain. Subsequent Statement warnings will be chained to this
SQLWarning.
The Warning chain is automatically cleared each time a statement
is (re)executed.
Note: If you are processing a ResultSet then any warnings
associated with ResultSet reads will be chained on the ResultSet
object.
the first SQLWarning on null exception: SQLException - if a database access error occurs |
isClosed | public boolean isClosed()(Code) | | |
setCursorName | public void setCursorName(String name) throws SQLException(Code) | | setCursorName defines the SQL cursor name that will be used by
subsequent execute methods. This name can then be used in SQL
positioned update/delete statements to identify the current row
in the ResultSet generated by this statement. If a database
doesn't support positioned update/delete, this method is a
no-op.
Parameters: name - the new cursor name exception: SQLException - if a database access error occurs |
setEscapeProcessing | public void setEscapeProcessing(boolean enable) throws SQLException(Code) | | If escape scanning is on (the default), the driver will do escape
substitution before sending the SQL to the database.
Parameters: enable - true to enable; false to disable exception: SQLException - if a database access error occurs |
setFetchDirection | public void setFetchDirection(int direction) throws SQLException(Code) | | JDBC 2.0
Gives the driver a hint as to the direction in which
the rows in a result set
will be processed. The hint applies only to result sets created
using this Statement object. The default value is
ResultSet.FETCH_FORWARD.
Note that this method sets the default fetch direction for
result sets generated by this Statement object.
Each result set has its own methods for getting and setting
its own fetch direction.
Parameters: direction - the initial direction for processing rows exception: SQLException - if a database access error occursor the given directionis not one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, orResultSet.FETCH_UNKNOWN |
setFetchSize | public void setFetchSize(int rows) throws SQLException(Code) | | JDBC 2.0
Gives the JDBC driver a hint as to the number of rows that should
be fetched from the database when more rows are needed. The number
of rows specified affects only result sets created using this
statement. If the value specified is zero, then the hint is ignored.
The default value is zero.
Parameters: rows - the number of rows to fetch exception: SQLException - if a database access error occurs, or thecondition 0 <= rows <= this.getMaxRows() is not satisfied. |
setMaxFieldSize | public void setMaxFieldSize(int max) throws SQLException(Code) | | Sets the maxFieldSize
Parameters: max - the new max column size limit; zero means unlimited exception: SQLException - if size exceeds buffer size |
setMaxRows | public void setMaxRows(int max) throws SQLException(Code) | | Set the maximum number of rows
Parameters: max - the new max rows limit; zero means unlimited exception: SQLException - if a database access error occurs See Also: getMaxRows |
setQueryTimeout | public void setQueryTimeout(int seconds) throws SQLException(Code) | | Sets the queryTimeout limit
Parameters: seconds - - the new query timeout limit in seconds exception: SQLException - if a database access error occurs |
|
|