|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.rio.MVAConnection
public class 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
Constructor Summary | |
---|---|
MVAConnection(com.sas.iom.SAS.IDataService sasDataService,
java.util.Properties info)
Constructs an MVAConnection object. |
|
MVAConnection(com.sas.iom.SAS.IWorkspace sasWorkspace,
java.util.Properties info)
Constructs an MVAConnection object. |
|
MVAConnection(java.lang.String url,
java.util.Properties info)
Constructs an MVAConnection object. |
|
MVAConnection(com.sas.rio.XUtil x,
java.util.Properties p)
|
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. |
java.sql.Statement |
createStatement()
Creates a Statement object. |
java.sql.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. |
java.sql.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. |
java.lang.String |
getCatalog()
Gets the Connection's current catalog name. |
int |
getHoldability()
Retrieves the current holdability of ResultSet objects created using this Connection object. |
java.sql.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. |
java.util.Map |
getTypeMap()
Gets the type-map object associated with this connection. |
java.sql.SQLWarning |
getWarnings()
Gets the warning reported by calls on this Connection. |
protected com.sas.rio.XUtil |
getXUtil()
|
boolean |
isClosed()
Tests to see if a Connection is closed. |
boolean |
isReadOnly()
SAS software does not support read-only connections. |
java.lang.String |
nativeSQL(java.lang.String sql)
Returns the input string. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Creates a CallableStatement object. |
java.sql.CallableStatement |
prepareCall(java.lang.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. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Creates a PreparedStatement object. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int autoGeneratedKeys)
Creates a default PreparedStatement object that has the capability to retrieve auto-generated keys. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] columnIndexes)
Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. |
java.sql.PreparedStatement |
prepareStatement(java.lang.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. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] columnNames)
Creates a default PreparedStatement object capable of returning the auto-generated keys designated by the given array. |
void |
releaseSavepoint(java.sql.Savepoint savepoint)
Removes the given Savepoint object from the current transaction. |
void |
rollback()
SAS software does not support transactions. |
void |
rollback(java.sql.Savepoint savepoint)
Undoes all changes made after the given Savepoint object was set. |
void |
setAutoCommit(boolean autoCommit)
Sets the auto-commit state. |
void |
setCatalog(java.lang.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. |
java.sql.Savepoint |
setSavepoint()
Creates an unnamed savepoint in the current transaction and returns the new Savepoint object that represents it. |
java.sql.Savepoint |
setSavepoint(java.lang.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(java.util.Map map)
Install a type-map object as the default type-map for this connection. |
protected void |
statementClosed(java.lang.Object statement)
|
Constructor Detail |
---|
public MVAConnection(java.lang.String url, java.util.Properties info) throws java.sql.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.
java.sql.SQLException
- This exception is thrown if a ShareNetException is detected.public MVAConnection(com.sas.iom.SAS.IDataService sasDataService, java.util.Properties info) throws java.sql.SQLException
sasDataService
- IDataService object.info
- java.util.Properties object which contains:
java.sql.SQLException
- This exception is thrown if a ShareNetException is detected.public MVAConnection(com.sas.iom.SAS.IWorkspace sasWorkspace, java.util.Properties info) throws java.sql.SQLException
sasWorkspace
- IWorkspace object.info
- java.util.Properties object which contains:
java.sql.SQLException
- This exception is thrown if a ShareNetException is detected.public MVAConnection(com.sas.rio.XUtil x, java.util.Properties p) throws java.sql.SQLException
java.sql.SQLException
Method Detail |
---|
public java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is thrown if an MVAStatement object cannot be created.public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
sql
- A SQL statement that may contain one or more '?' IN
parameter placeholders.
java.sql.SQLException
- This exception is thrown if a PreparedStatement object cannot be created.public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
sql
- A SQL statement that may contain one or more '?'
parameter placeholders. Typically this statement is a JDBC
function call escape string.
java.sql.SQLException
- This exception is required by the interface but it is never thrown.public java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
sql
- An input SQL string for optimization.
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
autoCommit
- This value must be True. SAS software does not support transactions.
java.sql.SQLException
- This exception is thrown if the value for autoCommit is False.public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
java.sql.SQLException
- This exception is thrown if an exception occurred while outstanding
statements were being closed.public void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown.public void close() throws java.sql.SQLException
Note: A Connection is automatically closed when it is garbage collected. Certain fatal errors also result in a closed Connection.
close
in interface java.sql.Connection
java.sql.SQLException
- This exception is thrown if an error condition is detected.public boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface but it is never thrown.public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
- This exception is thrown if an DatabaseMetaData object cannot be created.public void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
readOnly
- This parameter is ignored.
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface but it is never thrown.public java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
java.sql.SQLException
- if a database-access error occurs.public void setTransactionIsolation(int level) throws java.sql.SQLException
setTransactionIsolation
in interface java.sql.Connection
level
- The transaction level.
java.sql.SQLException
- This exception is thrown if the value of level is not valid.public int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
- This exception is required by the interface, but it is never thrown.public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
Note: Subsequent warnings will be chained to this SQLWarning.
getWarnings
in interface java.sql.Connection
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.Connection
java.sql.SQLException
- This exception is required by the interface but it is never thrown.public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
resultSetType
- a result set type, see ResultSet.TYPE_XXXresultSetConcurrency
- a concurrency type, see ResultSet.CONCUR_XXX
java.sql.SQLException
- This exception is thrown if a Statement object cannot be created.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
resultSetType
- a result set type, see ResultSet.TYPE_XXXresultSetConcurrency
- a concurrency type, see ResultSet.CONCUR_XXX
java.sql.SQLException
- This exception is thrown if a PreparedStatement object cannot be created.public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
resultSetType
- a result set type, see ResultSet.TYPE_XXXresultSetConcurrency
- a concurrency type, see ResultSet.CONCUR_XXX
java.sql.SQLException
- This exception is thrown if a CallableStatement object cannot be created.public java.util.Map getTypeMap() throws java.sql.SQLException
By default, the map returned is empty. Method not supported.
JDBC 2.0
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown as SAS software does not support user defined types.public void setTypeMap(java.util.Map map) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown as SAS software does not support user defined types.protected void statementClosed(java.lang.Object statement)
protected com.sas.rio.XUtil getXUtil()
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public void setHoldability(int holdability) throws java.sql.SQLException
setHoldability
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.public java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
- This exception is always thrown to indicate the method is not implemented.
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |