|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sas.rio.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 | |
long |
bookmarkLength
|
org.omg.CORBA.IntHolder |
bookmarkLengthHolder
|
int |
direction
|
com.sas.iom.SAS.IDataSet |
sasDataSet
|
com.sas.iom.SAS.IDataSetHolder |
sasDataSetHolder
|
com.sas.iom.SAS.ILibref |
sasLibref
|
long |
status
|
org.omg.CORBA.IntHolder |
statusHolder
|
Constructor Summary | |
MVAStatement()
Constructs a MVAStatement object for MVACallableStatement |
|
MVAStatement(MVAConnection connection)
Constructs an MVAStatement object. |
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. |
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. |
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. |
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. |
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 |
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. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public int direction
public long bookmarkLength
public long status
public org.omg.CORBA.IntHolder bookmarkLengthHolder
public com.sas.iom.SAS.IDataSet sasDataSet
public com.sas.iom.SAS.IDataSetHolder sasDataSetHolder
public org.omg.CORBA.IntHolder statusHolder
public com.sas.iom.SAS.ILibref sasLibref
Constructor Detail |
public MVAStatement()
public MVAStatement(MVAConnection connection)
connection
- the MVAConnection object associated with this objectMethod Detail |
public java.sql.ResultSet executeQuery(java.lang.String query) throws java.sql.SQLException
query
- Typically this is a static SQL SELECT statement.public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
sql
- A SQL INSERT, UPDATE or DELETE statement.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.
public int getMaxFieldSize() throws java.sql.SQLException
public void setMaxFieldSize(int max) throws java.sql.SQLException
max
- The new max column size limit. Zero means unlimited.public int getMaxRows() throws java.sql.SQLException
public void setMaxRows(int max) throws java.sql.SQLException
max
- The new max rows limit. Zero means unlimited.public void setEscapeProcessing(boolean enable) throws java.sql.SQLException
enable
- The value for this parameter must be False.public int getQueryTimeout() throws java.sql.SQLException
public void setQueryTimeout(int seconds) throws java.sql.SQLException
seconds
- The value of this parameter must be 0. Timeout is currently not supported.public void cancel() throws java.sql.SQLException
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
public void setCursorName(java.lang.String name) throws java.sql.SQLException
name
- The new cursor name.public boolean execute(java.lang.String sql) throws java.sql.SQLException
sql
- An SQL statementgetResultSet()
,
getUpdateCount()
,
getMoreResults()
public java.sql.ResultSet getResultSet() throws java.sql.SQLException
execute(java.lang.String)
public int getUpdateCount() throws java.sql.SQLException
execute(java.lang.String)
public boolean getMoreResults() throws java.sql.SQLException
execute(java.lang.String)
public void setFetchDirection(int direction) throws java.sql.SQLException
direction
- The initial direction for processing rows.public int getFetchDirection() throws java.sql.SQLException
public void setFetchSize(int rows) throws java.sql.SQLException
rows
- The number of rows to fetch.public int getFetchSize() throws java.sql.SQLException
public int getResultSetConcurrency() throws java.sql.SQLException
public int getResultSetType() throws java.sql.SQLException
public void addBatch(java.lang.String sql) throws java.sql.SQLException
sql
- typically this is a static SQL INSERT or UPDATE statementpublic void clearBatch() throws java.sql.SQLException
public int[] executeBatch() throws java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
public void createTable(java.lang.String libref, java.lang.String tableName, Column[] columnObject, java.lang.String options) throws com.sas.rio.RIOException
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 applicaaple SAS dataset options. May be NULL.public java.sql.ResultSet getTable(java.lang.String libref, java.lang.String tableName) throws com.sas.rio.RIOException
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.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 com.sas.rio.RIOException
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.public void deleteTable(java.lang.String libref, java.lang.String tableName) throws com.sas.rio.RIOException
libref
- The libref name. Cannot be NULL.tableName
- The name of the table to be deleted. By default,
the tableName dataset will be deleted.public void deleteTable(java.lang.String libref, java.lang.String tableName, java.lang.String tableType, java.lang.String alterPassword) throws com.sas.rio.RIOException
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |