|
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 MVAResultSet |
_currentResultSet
|
protected boolean |
describe
|
protected java.util.List<java.lang.String> |
librefs
|
protected int |
m_sasifyTableNames
|
protected int |
maxFieldSize
|
Method Summary | ||
---|---|---|
void |
addBatch(java.lang.String sql)
|
|
protected void |
addBatch2(com.sas.rio.ParsedQuery _parsedQuery,
java.lang.String[] parameters)
|
|
void |
cancel()
|
|
protected void |
checkClosed()
|
|
void |
clearBatch()
|
|
void |
clearWarnings()
|
|
void |
close()
|
|
MVADualResultSet |
createDualResultSet(java.lang.String libref,
java.lang.String tableName,
java.lang.String[] password,
java.lang.String options)
Creates a MVADualResultSet for access to server side formatted
data along with unformatted data. |
|
void |
createTable(java.lang.String libref,
java.lang.String tableName,
com.sas.rio.Column[] columnObject,
java.lang.String options)
Deprecated. prefer use of create table by executeUpdate with SQL grammar. |
|
void |
deleteRioTable(java.lang.String libref,
java.lang.String tableName)
|
|
void |
deleteRioTable(java.lang.String libref,
java.lang.String tableName,
java.lang.String tableType,
java.lang.String alterPassword)
|
|
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. |
|
protected boolean |
execute2(com.sas.rio.ParsedQuery pq,
java.lang.String[] parameters)
|
|
int[] |
executeBatch()
|
|
java.sql.ResultSet |
executeQuery(java.lang.String query)
|
|
protected java.sql.ResultSet |
executeQuery2(com.sas.rio.ParsedQuery pq,
java.lang.String[] parameters)
|
|
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. |
|
protected int |
executeUpdate2(com.sas.rio.ParsedQuery pq,
java.lang.String[] parameters)
|
|
java.sql.Connection |
getConnection()
|
|
java.sql.ResultSet |
getDualRioTable(java.lang.String libref,
java.lang.String tableName,
java.lang.String[] password,
java.lang.String options)
|
|
int |
getFetchDirection()
The IOM JDBC driver always returns ResultSet.FETCH_FORWARD
for the fetch direction, as calls to setFetchDirection(int)
are silently ignored. |
|
int |
getFetchSize()
|
|
java.sql.ResultSet |
getGeneratedKeys()
The MVAStatement implementation of getGeneratedKeys
always returns an empty result set. |
|
int |
getMaxFieldSize()
|
|
int |
getMaxRows()
|
|
boolean |
getMoreResults()
|
|
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()
The MVAStatement implementation of getQueryTimeout always
returns 0. |
|
java.sql.ResultSet |
getResultSet()
|
|
int |
getResultSetConcurrency()
|
|
int |
getResultSetHoldability()
|
|
int |
getResultSetType()
|
|
java.sql.ResultSet |
getRioTable(java.lang.String libref,
java.lang.String tableName)
|
|
java.sql.ResultSet |
getRioTable(java.lang.String libref,
java.lang.String tableName,
java.lang.String tableType,
java.lang.String[] password,
java.lang.String options)
|
|
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()
|
|
java.sql.SQLWarning |
getWarnings()
|
|
boolean |
isClosed()
|
|
boolean |
isPoolable()
|
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
|
|
void |
setCursorName(java.lang.String name)
The MVAStatement implementation of setCursorName has no
effect. |
|
void |
setEscapeProcessing(boolean enable)
|
|
void |
setFetchDirection(int direction)
The IOM JDBC driver silently ignores the hint to set the fetch direction. |
|
void |
setFetchSize(int rows)
|
|
void |
setMaxFieldSize(int max)
|
|
void |
setMaxRows(int max)
|
|
void |
setPoolable(boolean poolable)
|
|
void |
setQueryTimeout(int seconds)
The MVAStatement implementation of setQueryTimeout has no
effect. |
|
|
unwrap(java.lang.Class<T> iface)
|
Field Detail |
---|
protected final int m_sasifyTableNames
protected int maxFieldSize
protected MVAResultSet _currentResultSet
protected boolean describe
protected final java.util.List<java.lang.String> librefs
Method Detail |
---|
public java.sql.ResultSet executeQuery(java.lang.String query) throws java.sql.SQLException
executeQuery
in interface java.sql.Statement
java.sql.SQLException
protected java.sql.ResultSet executeQuery2(com.sas.rio.ParsedQuery pq, java.lang.String[] parameters) throws java.sql.SQLException, MVASQLException
java.sql.SQLException
MVASQLException
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.protected int executeUpdate2(com.sas.rio.ParsedQuery pq, java.lang.String[] parameters) throws MVASQLException, java.sql.SQLException
MVASQLException
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface java.sql.Statement
java.sql.SQLException
public int getMaxFieldSize() throws java.sql.SQLException
getMaxFieldSize
in interface java.sql.Statement
java.sql.SQLException
protected void checkClosed() throws MVASQLException
MVASQLException
public void setMaxFieldSize(int max) throws java.sql.SQLException
setMaxFieldSize
in interface java.sql.Statement
java.sql.SQLException
public int getMaxRows() throws java.sql.SQLException
getMaxRows
in interface java.sql.Statement
java.sql.SQLException
public void setMaxRows(int max) throws java.sql.SQLException
setMaxRows
in interface java.sql.Statement
java.sql.SQLException
public void setEscapeProcessing(boolean enable) throws java.sql.SQLException
setEscapeProcessing
in interface java.sql.Statement
java.sql.SQLException
public int getQueryTimeout() throws java.sql.SQLException
MVAStatement
implementation of getQueryTimeout
always
returns 0. Query timeout is not supported by the underlying database.
getQueryTimeout
in interface java.sql.Statement
java.sql.SQLException
public void setQueryTimeout(int seconds) throws java.sql.SQLException
MVAStatement
implementation of setQueryTimeout
has no
effect. Query timeout is not supported by the underlying database.
setQueryTimeout
in interface java.sql.Statement
java.sql.SQLException
public void cancel() throws java.sql.SQLException
cancel
in interface java.sql.Statement
java.sql.SQLException
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Statement
java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Statement
java.sql.SQLException
public void setCursorName(java.lang.String name) throws java.sql.SQLException
MVAStatement
implementation of setCursorName
has no
effect. Cursors are not supported by the underlying database.
setCursorName
in interface java.sql.Statement
java.sql.SQLException
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()
protected boolean execute2(com.sas.rio.ParsedQuery pq, java.lang.String[] parameters) throws java.sql.SQLException, MVASQLException
java.sql.SQLException
MVASQLException
public java.sql.ResultSet getResultSet() throws java.sql.SQLException
getResultSet
in interface java.sql.Statement
java.sql.SQLException
public int getUpdateCount() throws java.sql.SQLException
getUpdateCount
in interface java.sql.Statement
java.sql.SQLException
public boolean getMoreResults() throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
public void setFetchDirection(int direction) throws java.sql.SQLException
setFetchDirection
in interface java.sql.Statement
java.sql.SQLException
public int getFetchDirection() throws java.sql.SQLException
ResultSet.FETCH_FORWARD
for the fetch direction, as calls to setFetchDirection(int)
are silently ignored.
getFetchDirection
in interface java.sql.Statement
java.sql.SQLException
public void setFetchSize(int rows) throws java.sql.SQLException
setFetchSize
in interface java.sql.Statement
java.sql.SQLException
public int getFetchSize() throws java.sql.SQLException
getFetchSize
in interface java.sql.Statement
java.sql.SQLException
public int getResultSetConcurrency() throws java.sql.SQLException
getResultSetConcurrency
in interface java.sql.Statement
java.sql.SQLException
public int getResultSetType() throws java.sql.SQLException
getResultSetType
in interface java.sql.Statement
java.sql.SQLException
public void addBatch(java.lang.String sql) throws java.sql.SQLException
addBatch
in interface java.sql.Statement
java.sql.SQLException
protected void addBatch2(com.sas.rio.ParsedQuery _parsedQuery, java.lang.String[] parameters) throws java.sql.SQLException
java.sql.SQLException
public void clearBatch() throws java.sql.SQLException
clearBatch
in interface java.sql.Statement
java.sql.SQLException
public int[] executeBatch() throws java.sql.SQLException, java.sql.BatchUpdateException
executeBatch
in interface java.sql.Statement
java.sql.SQLException
java.sql.BatchUpdateException
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface java.sql.Statement
java.sql.SQLException
@Deprecated public void createTable(java.lang.String libref, java.lang.String tableName, com.sas.rio.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
MVAStatement
implementation of getGeneratedKeys
always returns an empty result set. The underlying database does not
support key generation.
getGeneratedKeys
in interface java.sql.Statement
java.sql.SQLException
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
public boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Statement
java.sql.SQLException
public void setPoolable(boolean poolable) throws java.sql.SQLException
setPoolable
in interface java.sql.Statement
java.sql.SQLException
public boolean isPoolable() throws java.sql.SQLException
isPoolable
in interface java.sql.Statement
java.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
public MVADualResultSet createDualResultSet(java.lang.String libref, java.lang.String tableName, java.lang.String[] password, java.lang.String options) throws java.sql.SQLException
MVADualResultSet
for access to server side formatted
data along with unformatted data.
createDualResultSet
in interface com.sas.rio.RIOStatementInterface
libref
- the containing libreftableName
- the table to openpassword
- password, or null
if none requiredoptions
- data set options, or null
if none provided
java.sql.SQLException
public java.sql.ResultSet getRioTable(java.lang.String libref, java.lang.String tableName) throws java.sql.SQLException
getRioTable
in interface com.sas.sql.RIOStatement
java.sql.SQLException
public java.sql.ResultSet getRioTable(java.lang.String libref, java.lang.String tableName, java.lang.String tableType, java.lang.String[] password, java.lang.String options) throws java.sql.SQLException
getRioTable
in interface com.sas.sql.RIOStatement
java.sql.SQLException
public java.sql.ResultSet getDualRioTable(java.lang.String libref, java.lang.String tableName, java.lang.String[] password, java.lang.String options) throws java.sql.SQLException
getDualRioTable
in interface com.sas.sql.RIOStatement
java.sql.SQLException
public void deleteRioTable(java.lang.String libref, java.lang.String tableName) throws java.sql.SQLException
deleteRioTable
in interface com.sas.sql.RIOStatement
java.sql.SQLException
public void deleteRioTable(java.lang.String libref, java.lang.String tableName, java.lang.String tableType, java.lang.String alterPassword) throws java.sql.SQLException
deleteRioTable
in interface com.sas.sql.RIOStatement
java.sql.SQLException
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |