|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.rio.MVAStatement
public class MVAStatement
A Statement object is used for executing a static SQL statement and obtaining the results produced by it.
Only one ResultSet per Statement can be open at any point in time. Therefore, if the reading of one ResultSet is interleaved with the reading of another, each must have been generated by different Statements. All statement execute methods implicitly close a statment's current ResultSet if an open one exists.
Connection.createStatement()
,
ResultSet
Field Summary | |
---|---|
protected java.lang.String |
libref
|
Constructor Summary | |
---|---|
MVAStatement(MVAConnection connection,
java.util.Properties props)
|
Method Summary | |
---|---|
void |
addBatch(java.lang.String sql)
JDBC 2.0 Adds a SQL command to the current batch of commmands for the statement. |
void |
cancel()
Cancel can be used by one thread to cancel a statement that is being executed by another thread. |
void |
clearBatch()
JDBC 2.0 Make the set of commands in the current batch empty. |
void |
clearWarnings()
Clears the warnings for this Statement. |
void |
close()
In many cases, it is desirable to immediately release a Statements's database and JDBC resources instead of waiting for this to happen when it is automatically closed; the close method provides this immediate release. |
void |
createTable(java.lang.String libref,
java.lang.String tableName,
Column[] columnObject,
java.lang.String options)
RIO Creates a new table with the name specified in the tableName String. |
void |
deleteTable(java.lang.String libref,
java.lang.String tableName)
Deletes the table with the name specified in the tableName String. |
void |
deleteTable(java.lang.String libref,
java.lang.String tableName,
java.lang.String tableType,
java.lang.String alterPassword)
RIO Deletes the table for the specified tableType with the name specified in the tableName String. |
boolean |
execute(java.lang.String sql)
Execute a SQL statement that may return multiple results. |
boolean |
execute(java.lang.String sql,
int autoGeneratedKeys)
Executes the given SQL statement and signals the driver with the given flag about whether the auto-generated keys produced by this Statement object should be made available for retrieval. |
boolean |
execute(java.lang.String sql,
int[] columnIndexes)
Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
boolean |
execute(java.lang.String sql,
java.lang.String[] columnNames)
Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
int[] |
executeBatch()
JDBC 2.0 Submit a batch of commands to the database for execution. |
java.sql.ResultSet |
executeQuery(java.lang.String query)
Execute a SQL statement that returns a single ResultSet. |
int |
executeUpdate(java.lang.String sql)
Executes an SQL INSERT, UPDATE or DELETE statement. |
int |
executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval. |
int |
executeUpdate(java.lang.String sql,
int[] columnIndexes)
Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
int |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
java.sql.Connection |
getConnection()
JDBC 2.0 Return the Connection that produced the Statement. |
int |
getFetchDirection()
JDBC 2.0 Gets the result set fetch direction. |
int |
getFetchSize()
JDBC 2.0 Gets the fetch size. |
java.sql.ResultSet |
getGeneratedKeys()
Retrieves any auto-generated keys created as a result of executing this Statement object. |
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. |
int |
getMaxRows()
The maxRows limit is the maximum number of rows that a ResultSet can contain. |
boolean |
getMoreResults()
Moves to a Statement's next result. |
boolean |
getMoreResults(int current)
Moves to this Statement object's next result, deals with any current ResultSet object(s) according to the instructions specified by the given flag, and returns true if the next result is a ResultSet object. |
int |
getQueryTimeout()
Gets the query timeout limit. |
java.sql.ResultSet |
getResultSet()
Gets the current result as a ResultSet. |
int |
getResultSetConcurrency()
JDBC 2.0 Gets the result set concurrency type. |
int |
getResultSetHoldability()
Retrieves the result set holdability for ResultSet objects generated by this Statement object. |
int |
getResultSetType()
JDBC 2.0 Gets the result set type. |
java.sql.ResultSet |
getTable(java.lang.String libref,
java.lang.String tableName)
RIO Gets an MVAResultSet object for the given table name.By default all the columns and all rows are selected. |
java.sql.ResultSet |
getTable(java.lang.String libref,
java.lang.String tableName,
java.lang.String tableType,
java.lang.String[] password,
java.lang.String options)
RIO Gets an MVAResultSet object for the given table name. |
int |
getUpdateCount()
Gets the current result as an update count.If the result is a ResultSet or there are no more results, -1 is returned. |
java.sql.SQLWarning |
getWarnings()
Gets the warnings for this statement. |
void |
setCursorName(java.lang.String name)
Sets the cursor name. |
void |
setEscapeProcessing(boolean enable)
If escape scanning is on (the default), the driver will do escape substitution before sending the SQL to the database. |
void |
setFetchDirection(int direction)
JDBC 2.0 Give a hint as to the direction in which the rows in a result set will be processed. |
void |
setFetchSize(int rows)
JDBC 2.0 Give the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. |
void |
setMaxFieldSize(int max)
The maxFieldSize limit (in bytes) is set to limit the size of data that can be returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR fields. |
void |
setMaxRows(int max)
The maxRows limit is set to limit the number of rows that any ResultSet can contain. |
void |
setQueryTimeout(int seconds)
Sets the query timeout limit. |
Field Detail |
---|
protected java.lang.String libref
Constructor Detail |
---|
public MVAStatement(MVAConnection connection, java.util.Properties props)
Method Detail |
---|
public java.sql.ResultSet executeQuery(java.lang.String query) throws java.sql.SQLException
executeQuery
in interface java.sql.Statement
query
- Typically this is a static SQL SELECT statement.
java.sql.SQLException
- This exception is thrown if an MVAException is detected.public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
sql
- A SQL INSERT, UPDATE or DELETE statement.
java.sql.SQLException
- This exception is thrown if an exception is detected.public void close() throws java.sql.SQLException
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.
close
in interface java.sql.Statement
java.sql.SQLException
- This exception is thrown if an error condition is
detected.public int getMaxFieldSize() throws java.sql.SQLException
getMaxFieldSize
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface but it is
never thrown.public void setMaxFieldSize(int max) throws java.sql.SQLException
setMaxFieldSize
in interface java.sql.Statement
max
- The new max column size limit. Zero means unlimited.
java.sql.SQLException
- This exception is thrown if the max field size is less
than 0.public int getMaxRows() throws java.sql.SQLException
getMaxRows
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface but it is
never thrown.public void setMaxRows(int max) throws java.sql.SQLException
setMaxRows
in interface java.sql.Statement
max
- The new max rows limit. Zero means unlimited.
java.sql.SQLException
- This exception is thrown if the max rows is less than 0.public void setEscapeProcessing(boolean enable) throws java.sql.SQLException
setEscapeProcessing
in interface java.sql.Statement
enable
- The value for this parameter must be False.
java.sql.SQLException
- This exception is thrown if value of enable is True.public int getQueryTimeout() throws java.sql.SQLException
getQueryTimeout
in interface java.sql.Statement
java.sql.SQLException
- if a database-access error occurs.public void setQueryTimeout(int seconds) throws java.sql.SQLException
setQueryTimeout
in interface java.sql.Statement
seconds
- The value of this parameter must be 0. Timeout is currently
not supported.
java.sql.SQLException
- This exception is thrown if value of seconds is not equal
to 0.public void cancel() throws java.sql.SQLException
cancel
in interface java.sql.Statement
java.sql.SQLException
- This exception may be thrown.public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface, but it is
never thrown.public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface, but it is
never thrown.public void setCursorName(java.lang.String name) throws java.sql.SQLException
setCursorName
in interface java.sql.Statement
name
- The new cursor name.
java.sql.SQLException
- This exception is required by the interface, but it is
never thrown.public boolean execute(java.lang.String sql) throws java.sql.SQLException
execute
in interface java.sql.Statement
sql
- An SQL statement
java.sql.SQLException
- This exception is thrown if an MvaException is detected.getResultSet()
,
getUpdateCount()
,
getMoreResults()
public java.sql.ResultSet getResultSet() throws java.sql.SQLException
getResultSet
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface but it is
never thrown.execute(java.lang.String)
public int getUpdateCount() throws java.sql.SQLException
getUpdateCount
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface but it is
never thrown.execute(java.lang.String)
public boolean getMoreResults() throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
- This exception may be thrown.execute(java.lang.String)
public void setFetchDirection(int direction) throws java.sql.SQLException
setFetchDirection
in interface java.sql.Statement
direction
- The initial direction for processing rows.
java.sql.SQLException
- This exception is thrown if the direction is not one of
ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or
ResultSet.FETCH_UNKNOWN.public int getFetchDirection() throws java.sql.SQLException
getFetchDirection
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface but it is
never thrown.public void setFetchSize(int rows) throws java.sql.SQLException
setFetchSize
in interface java.sql.Statement
rows
- The number of rows to fetch.
java.sql.SQLException
- This exception is thrown if the condition 0 <= rows <=
this.getMaxRows() is not satisfied.public int getFetchSize() throws java.sql.SQLException
getFetchSize
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface but it is
never thrown.public int getResultSetConcurrency() throws java.sql.SQLException
getResultSetConcurrency
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface but it is
never thrown.public int getResultSetType() throws java.sql.SQLException
getResultSetType
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface but it is
never thrown.public void addBatch(java.lang.String sql) throws java.sql.SQLException
addBatch
in interface java.sql.Statement
sql
- typically this is a static SQL INSERT or UPDATE statement
java.sql.SQLException
- if a database-access error occurs, or the driver does not
support batch statementspublic void clearBatch() throws java.sql.SQLException
clearBatch
in interface java.sql.Statement
java.sql.SQLException
- if a database-access error occurs, or the driver does not
support batch statementspublic int[] executeBatch() throws java.sql.SQLException, java.sql.BatchUpdateException
executeBatch
in interface java.sql.Statement
java.sql.SQLException
- if a database-access error occurs, or the driver does not
support batch statements
java.sql.BatchUpdateException
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface java.sql.Statement
java.sql.SQLException
- This exception is required by the interface but it is
never thrown.public void createTable(java.lang.String libref, java.lang.String tableName, Column[] columnObject, java.lang.String options) throws RIOException
createTable
in interface com.sas.rio.RIOStatementInterface
libref
- The libref name. Cannot be NULL.tableName
- The name of the table to be created. Table name cannot be
NULL.columnObject
- A Column Object array containing column names and attributes.
Column object cannot be NULL.options
- A String of applicable SAS DATASET options. May be NULL.
RIOException
- This exception may be thrown.public java.sql.ResultSet getTable(java.lang.String libref, java.lang.String tableName) throws java.sql.SQLException
getTable
in interface com.sas.rio.RIOStatementInterface
libref
- The libref name. Cannot be NULL.tableName
- The name of the table. Table name cannot be NULL. By default,
the driver looks for a dataset to open, if one doesn't exist
it looks for a view to open. If both exist, it opens a
dataset.
RIOException
- This exception may be thrown.
java.sql.SQLException
public java.sql.ResultSet getTable(java.lang.String libref, java.lang.String tableName, java.lang.String tableType, java.lang.String[] password, java.lang.String options) throws java.sql.SQLException
getTable
in interface com.sas.rio.RIOStatementInterface
libref
- The libref name. Cannot be NULL.tableName
- The name of the table to be opened.tableType
- The type of the table to be opened.It could be "DATA" or
"VIEW". If NULL, the driver looks for a dataset to open, if
one doesn't exist it looks for a view to open. If both exist,
it opens a dataset. This parameter is currently being ignored
and defaulted to NULL.password
- A String array of 3 elements specifying READ, WRITE and ALTER
passwords if any. This parameter can be NULL. The first
element is the READ password, the second the WRITE password
and the third the ALTER password.options
- A String whose contents can be any SAS dataset options
appropriate to the underlying engine and library. This
includes the WHERE clause. options can be NULL.
RIOException
- This exception may be thrown.
java.sql.SQLException
public void deleteTable(java.lang.String libref, java.lang.String tableName) throws RIOException
deleteTable
in interface com.sas.rio.RIOStatementInterface
libref
- The libref name. Cannot be NULL.tableName
- The name of the table to be deleted. By default, the tableName
dataset will be deleted.
RIOException
- This exception may be thrown.public void deleteTable(java.lang.String libref, java.lang.String tableName, java.lang.String tableType, java.lang.String alterPassword) throws RIOException
deleteTable
in interface com.sas.rio.RIOStatementInterface
libref
- The libref name. Cannot be NULL.tableName
- The name of the table to be deleted.tableType
- The type of the table. It could be "DATA" or "VIEW" or any
table type available in the database. If NULL, the tableName
dataset will be deleted.alterPassword
- The alter password.
RIOException
- This exception may be thrown.public int executeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.public int executeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.public int executeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.public boolean execute(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.public boolean execute(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.public boolean execute(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
execute
in interface java.sql.Statement
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.public java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException
getGeneratedKeys
in interface java.sql.Statement
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.public boolean getMoreResults(int current) throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.public int getResultSetHoldability() throws java.sql.SQLException
getResultSetHoldability
in interface java.sql.Statement
java.sql.SQLException
- Always thrown, to indicate that this method is not
implemented.
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |