com.sas.rio
Class MVADriver

java.lang.Object
  |
  +--com.sas.rio.MVADriver

public class MVADriver
extends java.lang.Object
implements java.sql.Driver

MVADriver class implements the Driver interface.

The DriverManager will try to load as many drivers as it can find and then for any given connection request, it will ask each driver in turn to try to connect to the target URL.

When a Driver class is loaded, it should create an instance of itself and register it with the DriverManager. This means that a user can load and register a driver by doing Class.forName("foo.bah.Driver").

See Also:
MVAConnection

Field Summary
static int majorVersion
           
static int minorVersion
           
 
Constructor Summary
MVADriver()
          Constructs an MVADriver object and registers the driver with the java.sql.DriverManager.
 
Method Summary
 boolean acceptsURL(java.lang.String url)
          Returns True if the driver thinks that it can open a connection to the given URL, else returns False.
 java.sql.Connection connect(java.lang.String url, java.util.Properties info)
          Attempts to make a database connection to the server specified by the URL.
 int getMajorVersion()
          Gets the driver's major version number.
 int getMinorVersion()
          Gets the driver's minor version number.
 java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info)
          Gets a DriverPropertyInfo object that lists the properties for the SAS/Integrated Object Model driver for JDBC.
 boolean jdbcCompliant()
          Reports whether the Driver is a genuine JDBC COMPLIANT (tm) driver.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

majorVersion

public static final int majorVersion

minorVersion

public static final int minorVersion
Constructor Detail

MVADriver

public MVADriver()
          throws java.sql.SQLException
Constructs an MVADriver object and registers the driver with the java.sql.DriverManager.
Throws:
java.sql.SQLException - This exception is thrown if an error condition is detected.
Method Detail

connect

public java.sql.Connection connect(java.lang.String url,
                                   java.util.Properties info)
                            throws java.sql.SQLException
Attempts to make a database connection to the server specified by the URL. The driver returns a NULL if it determines that it is the wrong kind of driver to connect to the server. The driver raises an SQLException if it is the right driver to connect to the server, but cannot connect to the database.

The connect method accepts a string representation of a URL and a java.util.Properties object as input.

Specified by:
connect in interface java.sql.Driver
Parameters:
url - The URL of the database to connect to. If the URL does not specify sasiom, a NULL is returned.

The URL must be of the form:

      jdbc:sasiom://hostname:portnumber
     
where hostname is the name of the machine where the MVA server is running, and portnumber is the port the MVA server is configured to use.

info - A list of connection arguments as a Properties object. The properties for the ShareNetConnection class are as follows:

userName
A valid username for the MVA server you specify in the URL.

password
The password that corresponds to the username you specify with the userName property.

librefs
A list of libnames and corresponding paths that specify the location of each data set your program will access. The librefs property value must be specifies as follows:
      (libname 'filepath'; libname 'filepath';...)
 

dbms
The name of the DBMS your program will access; the value must be eight characters padded with blanks. The default is "SQLVIEW ", which specifies that SAS data sets will be accessed. If you are not accessing SAS data, specify the name of the foreign DBMS as it is defined using SAS/ACCESS software.

dbms_options
Options for the foreign DBMS your program will access. Specify the options as you specify the database-definition arguments when using the PROC SQL statement CONNECT TO.

remarks
A Boolean value that determines whether the SAS/Integrated Object Model driver for JDBC returns the data set label for each data set in the library that your program accesses. If the value is True, the labels are returned; the default value is False.

Note: When this property is set to True, any operation that involves reading and returning data set labels can result in poor performance because each data set must be opened in order to read the label. For example, if this property is set to True, performance may be degraded when using the MVADatabaseMetaData.getTables() method to retrieve a description of the tables in a catalog.

undoPolicyNone
A Boolean value that determines whether changes to the data are undone when an UPDATE or INSERT statement generates errors. When the value is set to True (the recommended setting), the changes are not undone; when the value is set to False, the server attempts to undo the changes.

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, des, or tripledes. If no value is specified, then one of the server's favorite algorithms will be used.

ldapDbmd
a "true" or "false" parameter to indicate if LDAP is to be accessed for DBMD. (optional. Required only for LDAP DBMD access.) Defaulted to "false" if this parameter is not specified.
ldapProviderUrl
Url to connect to LDAP server. (optional. Required only for LDAP DBMD access.)
authentication
LDAP authentication ("simple" or "none"). (optional. Required only for LDAP DBMD access.)
baseDN
a base Distinguished Name for LDAP access. (optional. Required only for LDAP DBMD access.)
ldapUserName
Distinguished Name of a user to use to connect to LDAP. (optional. Required only for LDAP DBMD access.)
ldapPassword
Password that corresponds with ldapUserName. (optional. Required only for LDAP DBMD access.)

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.

Returns:
A connection to the URL if the correct form of URL is used; otherwise, a NULL is returned.
Throws:
java.sql.SQLException - This exception is thrown if a RIOException is detected.

acceptsURL

public boolean acceptsURL(java.lang.String url)
                   throws java.sql.SQLException
Returns True if the driver thinks that it can open a connection to the given URL, else returns False.
Specified by:
acceptsURL in interface java.sql.Driver
Parameters:
url - The URL of the database.
Returns:
True if this driver can connect to the given URL.
Throws:
java.sql.SQLException - This exception is required by the interface but it is never thrown.

getPropertyInfo

public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url,
                                                     java.util.Properties info)
                                              throws java.sql.SQLException
Gets a DriverPropertyInfo object that lists the properties for the SAS/Integrated Object Model driver for JDBC. The properties are as follows:

userName
A valid username for the MVA server you specify in the URL.

password
The password that corresponds to the username you specify with the userName property.

librefs
A list of libnames and corresponding paths that specify the location of each data set your program will access. The librefs property value must be specifies as follows:
      (libname 'filepath'; libname 'filepath';...)
 

dbms
The name of the DBMS your program will access; the value must be eight characters padded with blanks. The default is "SQLVIEW ", which specifies that SAS data sets will be accessed. If you are not accessing SAS data, specify the name of the foreign DBMS as it is defined using SAS/ACCESS software.

dbms_options
Options for the foreign DBMS your program will access. Specify the options as you specify the database-definition arguments when using the PROC SQL statement CONNECT TO.

remarks
A Boolean value that determines whether the SAS/Integrated Object Model driver for JDBC returns the data set label for each data set in the library that your program accesses. If the value is True, the labels are returned; the default value is False.

Note: When this property is set to True, any operation that involves reading and returning data set labels can result in poor performance because each data set must be opened in order to read the label. For example, if this property is set to True, performance may be degraded when using the MVADatabaseMetaData.getTables() method to retrieve a description of the tables in a catalog.

undoPolicyNone
A Boolean value that determines whether changes to the data are undone when an UPDATE or INSERT statement generates errors. When the value is set to True (the recommended setting), the changes are not undone; when the value is set to False, the server attempts to undo the changes.

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, des, or tripledes. If no value is specified, then one of the server's favorite algorithms will be used.

ldapDbmd
a "true" or "false" parameter to indicate if LDAP is to be accessed for DBMD. (optional) Defaulted to "false" if this parameter is not specified.
ldapProviderUrl
Url to connect to LDAP server.
authentication
LDAP authentication ("simple" or "none").
baseDN
a base Distinguished Name for LDAP access.
ldapUserName
Distinguished Name of a user to use to connect to LDAP.
ldapPassword
Password that corresponds with ldapUserName.

Specified by:
getPropertyInfo in interface java.sql.Driver
Parameters:
url - The URL of the database to connect to.
info - A list of tag/value pairs.
Returns:
An array of DriverPropertyInfo objects.
Throws:
java.sql.SQLException - This exception is required by the interface but it is never thrown.

getMajorVersion

public int getMajorVersion()
Gets the driver's major version number.
Specified by:
getMajorVersion in interface java.sql.Driver
Returns:
the driver's major version number.

getMinorVersion

public int getMinorVersion()
Gets the driver's minor version number.
Specified by:
getMinorVersion in interface java.sql.Driver
Returns:
the driver's minor version number.

jdbcCompliant

public boolean jdbcCompliant()
Reports whether the Driver is a genuine JDBC COMPLIANT (tm) driver. A driver may only report "true" here if it passes the JDBC compliance tests, otherwise it is required to return false.
Specified by:
jdbcCompliant in interface java.sql.Driver
Returns:
false.