|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sas.rio.MVAConnection
A Connection represents a session with a specific database. Within the context of a Connection, SQL statements are executed and results are returned.
A Connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, etc. This information is obtained with the getMetaData method.
Note: By default the Connection automatically commits changes after executing each statement. If auto commit has been disabled, an explicit commit must be done or database changes will not be saved.
DriverManager.getConnection(java.lang.String, java.util.Properties)
,
Statement
,
ResultSet
,
DatabaseMetaData
Field Summary |
Fields inherited from interface java.sql.Connection |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
Constructor Summary | |
MVAConnection(com.sas.iom.SAS.IDataService sasDataService,
Properties info)
Constructs an MVAConnection object. |
|
MVAConnection(com.sas.iom.SAS.IWorkspace sasWorkspace,
Properties info)
Constructs an MVAConnection object. |
|
MVAConnection(String url,
Properties info)
Constructs an MVAConnection object. |
Method Summary | |
void |
clearWarnings()
Clears the warnings. |
void |
close()
In some cases, it is desirable to immediately release a Connection's database and JDBC resources instead of waiting for them to be automatically released; the close method provides this immediate release. |
void |
commit()
Closes all the open Statement and PreparedStatement objects that are associated with this object. |
Statement |
createStatement()
Creates a Statement object. |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Same as createStatement() above, but allows the default result set type and result set concurrency type to be overridden. |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability. |
boolean |
getAutoCommit()
SAS software does not support transactions. |
String |
getCatalog()
Gets the Connection's current catalog name. |
int |
getHoldability()
Retrieves the current holdability of ResultSet objects created using this Connection object. |
DatabaseMetaData |
getMetaData()
A Connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, etc. |
int |
getTransactionIsolation()
SAS software does not support transactions. |
Map |
getTypeMap()
* Gets the type-map object associated with this connection. |
SQLWarning |
getWarnings()
Gets the warning reported by calls on this Connection. |
boolean |
isClosed()
Tests to see if a Connection is closed. |
boolean |
isReadOnly()
SAS software does not support read-only connections. |
String |
nativeSQL(String sql)
Returns the input string. |
CallableStatement |
prepareCall(String sql)
Creates a CallableStatement object. |
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency)
Same as prepareCall() above, but allows the default result set type and result set concurrency type to be overridden. |
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. |
PreparedStatement |
prepareStatement(String sql)
Creates a PreparedStatement object. |
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys)
Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys. |
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes)
Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency)
Same as prepareStatement() above, but allows the default result set type and result set concurrency type to be overridden. |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability. |
PreparedStatement |
prepareStatement(String sql,
String[] columnNames)
Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. |
void |
releaseSavepoint(Savepoint savepoint)
Removes the given Savepoint object from the current transaction. |
void |
rollback()
SAS software does not support transactions. |
void |
rollback(Savepoint savepoint)
Undoes all changes made after the given Savepoint object was set. |
void |
setAutoCommit(boolean autoCommit)
Sets the auto-commit state. |
void |
setCatalog(String catalog)
A sub-space of this Connection's database may be selected by setting a catalog name. |
void |
setHoldability(int holdability)
Changes the holdability of ResultSet objects created using this Connection object to the given holdability. |
void |
setReadOnly(boolean readOnly)
SAS software does not support read-only connections. |
Savepoint |
setSavepoint()
Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it. |
Savepoint |
setSavepoint(String name)
Creates a savepoint with the given name in the current transaction and returns the new Savepoint object that represents it. |
void |
setTransactionIsolation(int level)
SAS software does not support transactions. |
void |
setTypeMap(Map map)
* Install a type-map object as the default type-map for this connection. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
Constructor Detail |
public MVAConnection(String url, Properties info) throws SQLException
url
- initial input url containing host and port information.info
- java.util.Properties object which contains:
applyFormats
Note that the server's encryption policy is, by default, optional so no special action is needed to prepare an IOM BRIDGE server to use encryption. However, it is possible to set up the server so that encryption is required. Consult IOM BRIDGE server documentation for details.
SQLException
- This exception is thrown if a ShareNetException is detected.public MVAConnection(com.sas.iom.SAS.IDataService sasDataService, Properties info) throws SQLException
sasDataService
- IDataService object.info
- java.util.Properties object which contains:
SQLException
- This exception is thrown if a ShareNetException is detected.public MVAConnection(com.sas.iom.SAS.IWorkspace sasWorkspace, Properties info) throws SQLException
sasWorkspace
- IWorkspace object.info
- java.util.Properties object which contains:
SQLException
- This exception is thrown if a ShareNetException is detected.Method Detail |
public Statement createStatement() throws SQLException
createStatement
in interface Connection
SQLException
- This exception is thrown if an MVAStatement object cannot be created.public PreparedStatement prepareStatement(String sql) throws SQLException
prepareStatement
in interface Connection
sql
- A SQL statement that may contain one or more '?' IN
parameter placeholders.SQLException
- This exception is thrown if a PreparedStatement object cannot be created.public CallableStatement prepareCall(String sql) throws SQLException
prepareCall
in interface Connection
sql
- A SQL statement that may contain one or more '?'
parameter placeholders. Typically this statement is a JDBC
function call escape string.SQLException
- This exception is required by the interface but it is never thrown.public String nativeSQL(String sql) throws SQLException
nativeSQL
in interface Connection
sql
- An input SQL string for optimization.SQLException
- This exception is required by the interface, but it is never thrown.public void setAutoCommit(boolean autoCommit) throws SQLException
setAutoCommit
in interface Connection
autoCommit
- This value must be True. SAS software does not support transactions.SQLException
- This exception is thrown if the value for autoCommit is False.public boolean getAutoCommit() throws SQLException
getAutoCommit
in interface Connection
SQLException
- This exception is required by the interface, but it is never thrown.public void commit() throws SQLException
commit
in interface Connection
SQLException
- This exception is thrown if an exception occurred while outstanding
statements were being closed.public void rollback() throws SQLException
rollback
in interface Connection
SQLException
- This exception is always thrown.public void close() throws SQLException
Note: A Connection is automatically closed when it is garbage collected. Certain fatal errors also result in a closed Connection.
close
in interface Connection
SQLException
- This exception is thrown if an error condition is detected.public boolean isClosed() throws SQLException
isClosed
in interface Connection
SQLException
- This exception is required by the interface but it is never thrown.public DatabaseMetaData getMetaData() throws SQLException
getMetaData
in interface Connection
SQLException
- This exception is thrown if an DatabaseMetaData object cannot be created.public void setReadOnly(boolean readOnly) throws SQLException
setReadOnly
in interface Connection
readOnly
- This parameter is ignored.SQLException
- This exception is required by the interface, but it is never thrown.public boolean isReadOnly() throws SQLException
isReadOnly
in interface Connection
SQLException
- This exception is required by the interface, but it is never thrown.public void setCatalog(String catalog) throws SQLException
setCatalog
in interface Connection
SQLException
- This exception is required by the interface but it is never thrown.public String getCatalog() throws SQLException
getCatalog
in interface Connection
SQLException
- if a database-access error occurs.public void setTransactionIsolation(int level) throws SQLException
setTransactionIsolation
in interface Connection
level
- The transaction level.SQLException
- This exception is thrown if the value of level is not valid.public int getTransactionIsolation() throws SQLException
getTransactionIsolation
in interface Connection
SQLException
- This exception is required by the interface, but it is never thrown.public SQLWarning getWarnings() throws SQLException
Note: Subsequent warnings will be chained to this SQLWarning.
getWarnings
in interface Connection
SQLException
- This exception is required by the interface but it is never thrown.public void clearWarnings() throws SQLException
clearWarnings
in interface Connection
SQLException
- This exception is required by the interface but it is never thrown.public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
createStatement
in interface Connection
resultSetType
- a result set type, see ResultSet.TYPE_XXXresultSetConcurrency
- a concurrency type, see ResultSet.CONCUR_XXXSQLException
- This exception is thrown if a Statement object cannot be created.public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareStatement
in interface Connection
resultSetType
- a result set type, see ResultSet.TYPE_XXXresultSetConcurrency
- a concurrency type, see ResultSet.CONCUR_XXXSQLException
- This exception is thrown if a PreparedStatement object cannot be created.public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareCall
in interface Connection
resultSetType
- a result set type, see ResultSet.TYPE_XXXresultSetConcurrency
- a concurrency type, see ResultSet.CONCUR_XXXSQLException
- This exception is thrown if a CallableStatement object cannot be created.public Map getTypeMap() throws SQLException
* By default, the map returned is empty. Method not supported.
JDBC 2.0getTypeMap
in interface Connection
SQLException
- This exception is always thrown as SAS software does not support user defined types.
public void setTypeMap(Map map) throws SQLException
setTypeMap
in interface Connection
SQLException
- This exception is always thrown as SAS software does not support user defined types.
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
createStatement
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public int getHoldability() throws SQLException
getHoldability
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareCall
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
prepareStatement
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
prepareStatement
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareStatement
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
prepareStatement
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public void releaseSavepoint(Savepoint savepoint) throws SQLException
releaseSavepoint
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public void rollback(Savepoint savepoint) throws SQLException
rollback
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public void setHoldability(int holdability) throws SQLException
setHoldability
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public Savepoint setSavepoint() throws SQLException
setSavepoint
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.public Savepoint setSavepoint(String name) throws SQLException
setSavepoint
in interface Connection
SQLException
- This exception is always thrown to indicate the method is not implemented.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |