The following example
configures a SAS JDBC driver properties file to connect to the SPD
Server SNET process that is running at port 5401 on host myhost.unx.sas.com,
to access tables for SPD Server running on host myhost.unx.sas.com
at port 5400:
//CONNECT TO THE SPD SERVER HOST BY USING A CONNECTION PROPERTY LIST
Class.forName("com.sas.net.sharenet.ShareNetDriver");
props = new Properties();
props.setProperty("dbms", "SPDS");
props.setProperty("dbmsOptions", "dbq='spdstmp' host='myhost.unx.sas.com'
serv=’5400’ ");
props.setProperty("shareUser","spduser");
props.setProperty("sharePassword", "spdpw");
props.setProperty("shareRelease", "V9");
connection = DriverManager.getConnection(
"jdbc:sharenet://myhost.unx.sas.com:5401", props);
In the code:
-
-
dbms_options is
the SPD Server domain name (spdstmp), the
SPD Server host name (myhost.unx.sas.com),
and the port number (5400) assigned to SPD
Server tables
-
shareUser is
the SPD Server User ID.
-
sharePassword is
the SPD Server user password.
-
shareRelease is
set to V9.
-
jdbc:sharenet is
the SPD Server SNET process host name and port number.
For more detailed information
about JDBC connections for SPD Server data, see
SAS 9.4 Drivers for JDBC Cookbook.
Chapter 4 contains connection recipe information for accessing DBMS
and SPD Server data.