Class MVAConnection
- All Implemented Interfaces:
AutoCloseable,Connection,Wrapper
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.
- See Also:
-
Field Summary
FieldsFields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Constructor Summary
ConstructorsConstructorDescriptionMVAConnection(IDataService sasDataService, Properties info) Constructs an MVAConnection object.MVAConnection(IWorkspace sasWorkspace, Properties info) Constructs an MVAConnection object.MVAConnection(RIOUtil x, Properties info) MVAConnection(String url, Properties info) Constructs an MVAConnection object. -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(java.util.concurrent.Executor arg0) voidvoidclose()voidcommit()ArraycreateArrayOf(String typeName, Object[] elements) This method is not supported.BlobThis method is not supported.ClobThis method is not supported.NClobThis method is not supported.SQLXMLThis method is not supported.StatementStatementcreateStatement(int resultSetType, int resultSetConcurrency) StatementcreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) TheMVAConnectionimplementation ofcreateStatement(int, int, int)throws aSQLFeatureNotSupportedExceptionif the value provided forresultSetHoldabilityis notResultSet.CLOSE_CURSORS_AT_COMMIT.StructcreateStruct(String typeName, Object[] attributes) TheMVAConnectionimplementation ofcreateStruct(String, Object[])always throws aSQLFeatureNotSupportedException.booleanThe SAS IOM JDBC driver does not support transactions.StringTheMVAConnectionimplementation ofgetCatalogalways returns .PropertiesTheMVAConnectionimplementation ofgetClientInfoalways returns an empty properties object.StringgetClientInfo(String name) TheMVAConnectionimplementation ofgetClientInfo(String)always returns null.intStringDatabaseMetaDataintprotected RIOUtilStringintTheMVAConnectionimplementation ofgetTransactionIsolationalways returnsConnection.TRANSACTION_NONE.Map<String, Class<?>> The MVAConnection implementation ofgetTypeMap()always throws aSQLFeatureNotSupportedException.SQLWarningbooleanisClosed()booleanTheMVAConnectionimplementation ofgetReadOnly()always returns false.booleanisValid(int timeout) booleanisWrapperFor(Class<?> iface) StringnativeSQL(String sql) CallableStatementprepareCall(String sql) CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency) CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.PreparedStatementprepareStatement(String sql) PreparedStatementprepareStatement(String sql, int autoGeneratedKeys) TheMVAConnectionimplementation ofprepareStatement(String, int)always throwsSQLFeatureNotSupportedException.PreparedStatementprepareStatement(String sql, int[] columnIndexes) TheMVAConnectionimplementation ofprepareStatement(String, int[])always throwsSQLFeatureNotSupportedException.PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency) PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) PreparedStatementprepareStatement(String sql, String[] columnNames) TheMVAConnectionimplementation ofprepareStatement(String, String[])always throwsSQLFeatureNotSupportedException.voidreleaseSavepoint(Savepoint savepoint) TheMVAConnectionimplementation ofreleaseSavepointalways throwsSQLFeatureNotSupportedException.voidrollback()SAS software does not support transactions.voidrollback(Savepoint savepoint) TheMVAConnectionimplementation ofrollbackalways throwsSQLFeatureNotSupportedException.voidsetAutoCommit(boolean autoCommit) The SAS IOM JDBC driver does not support transactions.voidsetCatalog(String catalog) TheMVAConnectionimplementation ofsetCatalogsilently ignores the value provided forcatalog.voidsetClientInfo(String name, String value) TheMVAConnectionimplementation ofsetClientInfo(String, String)adds a warning to theConnectionobject for any property provided.voidsetClientInfo(Properties properties) TheMVAConnectionimplementation ofsetClientInfo(Properties)adds a warning to theConnectionobject for all properties provided.voidsetHoldability(int holdability) TheMVAConnectionimplementation ofsetHoldability(int)only supportsResultSet.CLOSE_CURSORS_AT_COMMITfor holdability.voidsetNetworkTimeout(java.util.concurrent.Executor arg0, int arg1) voidsetReadOnly(boolean readOnly) TheMVAConnectionimplementation ofsetReadOnly(boolean)ignores the value of readOnly.SavepointThe MVAConnection implementation ofsetSavepoint()always throwsSQLFeatureNotSupportedException.SavepointsetSavepoint(String name) The MVAConnection implementation ofsetSavepoint(String)always throwsSQLFeatureNotSupportedException.voidsetSchema(String arg0) voidsetTransactionIsolation(int level) SAS software does not support transactions.voidsetTypeMap(Map<String, Class<?>> map) The MVAConnection implementation ofsetTypeMap()always throws aSQLFeatureNotSupportedException.<T> Tunwrap(Class<T> iface) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Field Details
-
resultSetType
protected int resultSetType -
resultSetConcurrency
protected int resultSetConcurrency
-
-
Constructor Details
-
MVAConnection
public MVAConnection(String url, Properties info) throws SQLException Constructs an MVAConnection object.- Parameters:
url- initial input url containing host and port information.info- java.util.Properties object which contains:- userName
- MVA server access user name
- password
- MVA server access password
- librefs
- a semicolon delimited list of 'name filepath'.
- encryptionPolicy
- whether or not JavaBridge should attempt to negotiate with the
server over which encryption algorithm to use and what to do if
the negotiations fail. Possible values:
- none
- do not use encryption. This is the default.
- optional
- attempt to use encryption but, if algorithm negotiation fails, continue with an unencrypted session
- required
- attempt to use encryption but, if algorithm negotiation fails, fail the connection
- encryptionContent
- specifies which messages should be encrypted if encryption is
used. Possible values:
- all
- encrypt all messages. This is the default.
- authentication
- encrypt only messages that contain user name and password information.
- encryptionAlgorithms
- the list of algorithms you are willing to use in order of
preference. Values in the list should be separated by commas and
chosen from sasproprietary, rc2, rc4, aes, des, or tripledes. If
no value is specified, then one of the server's favorite
algorithms will be used.
applyFormats- specifies whether or not column formats are applied when
retrieving data. If the value is true, all data is returned as
Strings. For any column, the format used is the one defined on the
column in the data set. If "applyFormats" is set to false (the
default case) no formatting is applied.
segmentLength- Specifies the segment length value, in bytes, for character annotations when initially added to a SAS result set. This property is not used with result sets that already have annotations. The server uses the segment length to define the buffer width of character extended attribute values. These values can span multiple segments. The default value of the segment length is 256 bytes.
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.
- Throws:
SQLException- This exception is thrown if a ShareNetException is detected.
-
MVAConnection
public MVAConnection(IDataService sasDataService, Properties info) throws SQLException Constructs an MVAConnection object.- Parameters:
sasDataService- IDataService object.info- java.util.Properties object which contains:- userName
- MVA server access user name
- password
- MVA server access password
- librefs
- a semicolon delimited list of 'name filepath'.
- Throws:
SQLException- This exception is thrown if a ShareNetException is detected.
-
MVAConnection
public MVAConnection(IWorkspace sasWorkspace, Properties info) throws SQLException Constructs an MVAConnection object.- Parameters:
sasWorkspace- IWorkspace object.info- java.util.Properties object which contains:- userName
- MVA server access user name
- password
- MVA server access password
- librefs
- a semicolon delimited list of 'name filepath'.
- Throws:
SQLException- This exception is thrown if a ShareNetException is detected.
-
MVAConnection
public MVAConnection(RIOUtil x, Properties info) throws SQLException - Throws:
SQLException
-
-
Method Details
-
getIdForLogger
public String getIdForLogger() -
createStatement
public Statement createStatement() throws SQLException- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql) throws SQLException - Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
nativeSQL
public String nativeSQL(String sql) throws SQLException - Specified by:
nativeSQLin interfaceConnection- Throws:
SQLException
-
setAutoCommit
public void setAutoCommit(boolean autoCommit) throws SQLException The SAS IOM JDBC driver does not support transactions. CallingsetAutoCommit(boolean)with a value of false will cause an exception.- Specified by:
setAutoCommitin interfaceConnection- Throws:
SQLException
-
getAutoCommit
public boolean getAutoCommit() throws SQLExceptionThe SAS IOM JDBC driver does not support transactions.getAutoCommit()will always return true.- Specified by:
getAutoCommitin interfaceConnection- Throws:
SQLException
-
commit
public void commit() throws SQLException- Specified by:
commitin interfaceConnection- Throws:
SQLException
-
rollback
public void rollback() throws SQLExceptionSAS software does not support transactions. This method is not supported.- Specified by:
rollbackin interfaceConnection- Throws:
SQLException- This exception is always thrown.
-
close
public void close() throws SQLException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Throws:
SQLException
-
isClosed
public boolean isClosed() throws SQLException- Specified by:
isClosedin interfaceConnection- Throws:
SQLException
-
getMetaData
public DatabaseMetaData getMetaData() throws SQLException- Specified by:
getMetaDatain interfaceConnection- Throws:
SQLException
-
setReadOnly
public void setReadOnly(boolean readOnly) throws SQLException TheMVAConnectionimplementation ofsetReadOnly(boolean)ignores the value of readOnly. The IOM JDBC Driver does not support read only connections.- Specified by:
setReadOnlyin interfaceConnection- Throws:
SQLException
-
isReadOnly
public boolean isReadOnly() throws SQLExceptionTheMVAConnectionimplementation ofgetReadOnly()always returns false. The IOM JDBC Driver does not support read only connections.- Specified by:
isReadOnlyin interfaceConnection- Throws:
SQLException
-
setCatalog
public void setCatalog(String catalog) throws SQLException TheMVAConnectionimplementation ofsetCatalogsilently ignores the value provided forcatalog. The IOM JDBC Driver does not support catalogs.- Specified by:
setCatalogin interfaceConnection- Throws:
SQLException
-
getCatalog
public String getCatalog() throws SQLExceptionTheMVAConnectionimplementation ofgetCatalogalways returns . The IOM JDBC Driver does not support catalogs.- Specified by:
getCatalogin interfaceConnection- Throws:
SQLException
-
setTransactionIsolation
public void setTransactionIsolation(int level) throws SQLException SAS software does not support transactions. The only valid input value is java.sql.Connection.TRANSACTION_NONE.- Specified by:
setTransactionIsolationin interfaceConnection- Throws:
SQLException
-
getTransactionIsolation
public int getTransactionIsolation() throws SQLExceptionTheMVAConnectionimplementation ofgetTransactionIsolationalways returnsConnection.TRANSACTION_NONE. The SAS IOM JDBC driver does not support transactions.- Specified by:
getTransactionIsolationin interfaceConnection- Throws:
SQLException
-
getWarnings
public SQLWarning getWarnings() throws SQLException- Specified by:
getWarningsin interfaceConnection- Throws:
SQLException
-
clearWarnings
public void clearWarnings() throws SQLException- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
getTypeMap
public Map<String,Class<?>> getTypeMap() throws SQLExceptionThe MVAConnection implementation ofgetTypeMap()always throws aSQLFeatureNotSupportedException. Base SAS does not support SQL structured types.- Specified by:
getTypeMapin interfaceConnection- Throws:
SQLException
-
setTypeMap
public void setTypeMap(Map<String, Class<?>> map) throws SQLExceptionThe MVAConnection implementation ofsetTypeMap()always throws aSQLFeatureNotSupportedException. Base SAS does not support SQL structured types.- Specified by:
setTypeMapin interfaceConnection- Throws:
SQLException
-
getRioUtil
protected RIOUtil getRioUtil() -
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException TheMVAConnectionimplementation ofcreateStatement(int, int, int)throws aSQLFeatureNotSupportedExceptionif the value provided forresultSetHoldabilityis notResultSet.CLOSE_CURSORS_AT_COMMIT.- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
getHoldability
public int getHoldability() throws SQLException- Specified by:
getHoldabilityin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. Empty method implementation for JDK1.4 compliance.- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException- This exception is always thrown to indicate the method is not implemented.
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException TheMVAConnectionimplementation ofprepareStatement(String, int)always throwsSQLFeatureNotSupportedException. The IOM JDBC driver does not support auto-generated keys.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException TheMVAConnectionimplementation ofprepareStatement(String, int[])always throwsSQLFeatureNotSupportedException. The IOM JDBC driver does not support auto-generated keys.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException TheMVAConnectionimplementation ofprepareStatement(String, String[])always throwsSQLFeatureNotSupportedException. The IOM JDBC driver does not support auto-generated keys.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
releaseSavepoint
public void releaseSavepoint(Savepoint savepoint) throws SQLException TheMVAConnectionimplementation ofreleaseSavepointalways throwsSQLFeatureNotSupportedException. The IOM JDBC driver does not support transactions.- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException
-
rollback
public void rollback(Savepoint savepoint) throws SQLException TheMVAConnectionimplementation ofrollbackalways throwsSQLFeatureNotSupportedException. The IOM JDBC driver does not support transactions.- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
setHoldability
public void setHoldability(int holdability) throws SQLException TheMVAConnectionimplementation ofsetHoldability(int)only supportsResultSet.CLOSE_CURSORS_AT_COMMITfor holdability.- Specified by:
setHoldabilityin interfaceConnection- Throws:
SQLException
-
setSavepoint
public Savepoint setSavepoint() throws SQLExceptionThe MVAConnection implementation ofsetSavepoint()always throwsSQLFeatureNotSupportedException. The IOM JDBC driver does not support transactions.- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSavepoint
public Savepoint setSavepoint(String name) throws SQLException The MVAConnection implementation ofsetSavepoint(String)always throwsSQLFeatureNotSupportedException. The IOM JDBC driver does not support transactions.- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
createClob
public Clob createClob() throws SQLExceptionThis method is not supported.Constructs an object that implements the
Clobinterface. The object returned initially contains no data. ThesetAsciiStream,setCharacterStreamandsetStringmethods of theClobinterface may be used to add data to theClob.- Specified by:
createClobin interfaceConnection- Throws:
SQLException- Always thrown, to indicate that this method is not implemented.- Since:
- 1.6
-
createBlob
public Blob createBlob() throws SQLExceptionThis method is not supported.Constructs an object that implements the
Blobinterface. The object returned initially contains no data. ThesetBinaryStreamandsetBytesmethods of theBlobinterface may be used to add data to theBlob.- Specified by:
createBlobin interfaceConnection- Throws:
SQLException- Always thrown, to indicate that this method is not implemented.- Since:
- 1.6
-
createNClob
public NClob createNClob() throws SQLExceptionThis method is not supported.Constructs an object that implements the
NClobinterface. The object returned initially contains no data. ThesetAsciiStream,setCharacterStreamandsetStringmethods of theNClobinterface may be used to add data to theNClob.- Specified by:
createNClobin interfaceConnection- Throws:
SQLException- Always thrown, to indicate that this method is not implemented.- Since:
- 1.6
-
createSQLXML
public SQLXML createSQLXML() throws SQLExceptionThis method is not supported.Constructs an object that implements the
SQLXMLinterface. The object returned initially contains no data. ThecreateXmlStreamWriterobject andsetStringmethod of theSQLXMLinterface may be used to add data to theSQLXMLobject.- Specified by:
createSQLXMLin interfaceConnection- Throws:
SQLException- Always thrown, to indicate that this method is not implemented.- Since:
- 1.6
-
isValid
public boolean isValid(int timeout) throws SQLException - Specified by:
isValidin interfaceConnection- Throws:
SQLException
-
setClientInfo
public void setClientInfo(String name, String value) throws SQLClientInfoException TheMVAConnectionimplementation ofsetClientInfo(String, String)adds a warning to theConnectionobject for any property provided. The IOM JDBC Driver does not support the ability to set or retrieve client info properties.- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
setClientInfo
public void setClientInfo(Properties properties) throws SQLClientInfoException TheMVAConnectionimplementation ofsetClientInfo(Properties)adds a warning to theConnectionobject for all properties provided. The IOM JDBC Driver does not support the ability to set or retrieve client info properties.- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
getClientInfo
public String getClientInfo(String name) throws SQLException TheMVAConnectionimplementation ofgetClientInfo(String)always returns null. The IOM JDBC Driver does not support the ability to set or retrieve client info properties.- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
getClientInfo
public Properties getClientInfo() throws SQLExceptionTheMVAConnectionimplementation ofgetClientInfoalways returns an empty properties object. The IOM JDBC Driver does not support the ability to set or retrieve client info properties.- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
createArrayOf
public Array createArrayOf(String typeName, Object[] elements) throws SQLException This method is not supported.Factory method for creating Array objects.
Note: When
createArrayOfis used to create an array object that maps to a primitive data type, then it is implementation-defined whether theArrayobject is an array of that primitive data type or an array ofObject.Note: The JDBC driver is responsible for mapping the elements
Objectarray to the default JDBC SQL type defined in java.sql.Types for the given class ofObject. The default mapping is specified in Appendix B of the JDBC specification. If the resulting JDBC type is not the appropriate type for the given typeName then it is implementation defined whether anSQLExceptionis thrown or the driver supports the resulting conversion.- Specified by:
createArrayOfin interfaceConnection- Parameters:
typeName- the SQL name of the type the elements of the array map to. The typeName is a database-specific name which may be the name of a built-in type, a user-defined type or a standard SQL type supported by this database. This is the value returned byArray.getBaseTypeNameelements- the elements that populate the returned object- Returns:
- an Array object whose elements map to the specified SQL type
- Throws:
SQLException- Always thrown, to indicate that this method is not implemented.- Since:
- 1.6
-
createStruct
public Struct createStruct(String typeName, Object[] attributes) throws SQLException TheMVAConnectionimplementation ofcreateStruct(String, Object[])always throws aSQLFeatureNotSupportedException. Base SAS does not support SQL structured types.- Specified by:
createStructin interfaceConnection- Throws:
SQLException
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException - Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException - Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
abort
public void abort(java.util.concurrent.Executor arg0) throws SQLException - Specified by:
abortin interfaceConnection- Throws:
SQLException
-
getNetworkTimeout
public int getNetworkTimeout() throws SQLException- Specified by:
getNetworkTimeoutin interfaceConnection- Throws:
SQLException
-
getSchema
public String getSchema() throws SQLException- Specified by:
getSchemain interfaceConnection- Throws:
SQLException
-
setNetworkTimeout
public void setNetworkTimeout(java.util.concurrent.Executor arg0, int arg1) throws SQLException - Specified by:
setNetworkTimeoutin interfaceConnection- Throws:
SQLException
-
setSchema
public void setSchema(String arg0) throws SQLException - Specified by:
setSchemain interfaceConnection- Throws:
SQLException
-