com.sas.net.sharenet
Class ShareNetDriver

java.lang.Object
  |
  +--com.sas.net.sharenet.ShareNetDriver
All Implemented Interfaces:

public class ShareNetDriver
extends Object
implements java.sql.Driver

This is the SAS/SHARE Driver for JDBC implementation for java.sql.Driver.


Field Summary
static int majorVersion
           
static int minorVersion
           
 
Constructor Summary
ShareNetDriver()
          Constructs a ShareNetDriver object and registers the SAS/SHARE driver for JDBC with the java.sql.DriverManager.
 
Method Summary
 boolean acceptsURL(String url)
          Returns a value of True if the driver accepts this style of URL and the specified server.
 Connection connect(String url, 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.
 DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
          Gets a DriverPropertyInfo object that lists the properties for the SAS/SHARE driver for JDBC.
 boolean jdbcCompliant()
          Returns whether the Driver is JDBC COMPLIANT.
 
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

ShareNetDriver

public ShareNetDriver()
               throws SQLException
Constructs a ShareNetDriver object and registers the SAS/SHARE driver for JDBC with the java.sql.DriverManager.
Throws:
SQLException - This exception is thrown if a ShareNetException is detected.
Method Detail

connect

public Connection connect(String url,
                          Properties info)
                   throws 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. If the URL does not specify sharenet, a NULL is returned. The URL must be of the form:

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

The properties argument can be used to pass tag/value pairs as connection arguments. The properties for the ShareNetConnection class are as follows:

shareUser
A valid username for the SAS/SHARE server you specify in the URL.

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

appname
The name of the applet or application you're creating. This name will appear in the all server log entries related to the program. It is limited to eight characters; names longer than eight characters will be truncated.

sapw
The access password for the SAS/SHARE server your program will connect to.

pt2dbpw
The SQL Pass-Through access password for the SAS/SHARE server your program will connect to. SQL Pass-Through access permits you program to access external database management systems (DBMS).

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/SHARE 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 ShareNetDatabaseMetaData.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.

routerUrl
The URL of the Message Router. The routerUrl property value must be specifies as follows:
      (routerUrl http://your_server/cgi-bin/shrcgi)
 

where http://your_server/cgi-bin/shrcgi is the URL of the Message Router (shrcgi or shrcgi.exe), one of the tunnel feature's server programs.

Note: Users may alternatively pass in properties embedded in the url. The syntax for this is "url?[attr=value]&[...]", where attr is a valid property name, and value is a valid name. If users make use of this functionality, then if properties are also passed in via the Properties object, the properties in the url will, in the case of conflicts, override those in the Properties object. This means that if a user specifies a libref (for example) in both the URL and in the Properties object, the libref in the url will be the one to take precedence, and the one in the Properties object will be ignored.
Specified by:
connect in interface Driver
Parameters:
url - The URL of the database to connect to.
info - A list of connection arguments.
Returns:
A connection to the URL if the correct form of URL is used; otherwise, a NULL is returned.
Throws:
SQLException - This exception is thrown if a ShareNetException is detected.

acceptsURL

public boolean acceptsURL(String url)
                   throws SQLException
Returns a value of True if the driver accepts this style of URL and the specified server.
Specified by:
acceptsURL in interface Driver
Parameters:
url - The URL of the database.
Returns:
True if this driver can connect to the given URL.
Throws:
SQLException - This exception is thrown if a ShareNetException is detected.

getPropertyInfo

public DriverPropertyInfo[] getPropertyInfo(String url,
                                            Properties info)
Gets a DriverPropertyInfo object that lists the properties for the SAS/SHARE driver for JDBC. The propeties are as follows:

shareUser
A valid username for the SAS/SHARE server you specify in the URL.

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

appname
The name of the applet or application you're creating. This name will appear in the all server log entries related to the program. It is limited to eight characters; names longer than eight characters will be truncated.

sapw
The access password for the SAS/SHARE server your program will connect to.

pt2dbpw
The SQL Pass-Through access password for the SAS/SHARE server your program will connect to. SQL Pass-Through access permits you program to access external database management systems (DBMS).

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/SHARE 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 ShareNetDatabaseMetaData.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.

routerUrl
The URL of the Message Router. The routerUrl property value must be specifies as follows:
      (routerUrl http://your_server/cgi-bin/shrcgi)
 

where http://your_server/cgi-bin/shrcgi is the URL of the Message Router (shrcgi or shrcgi.exe), one of the tunnel feature's server programs.

Specified by:
getPropertyInfo in interface Driver
Parameters:
url - The URL of the database to connect to.
info - A list of tag/value pairs.
Returns:
An array of DriverPropertyInfo objects.

getMajorVersion

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

getMinorVersion

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

jdbcCompliant

public boolean jdbcCompliant()
Returns whether the Driver is JDBC COMPLIANT.
Specified by:
jdbcCompliant in interface Driver
Returns:
False.



Copyright © 2003 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 09 Jul 2004 16:13:37