Using JDBC to Access SPD Server Tables

Access SPD Server Tables from JDBC

JDBC access to SPD Server is performed through the SPD Server SNET process. Review your server start-up logs to verify that the spdssnet process is running.
To access SPD Server Tables from JDBC:
  1. Download and install the SAS JDBC Driver from Downloads: SAS Drivers for JDBC.
  2. Configure the SAS JDBC driver properties file to use the SPD Server SNET process as its sharenet server.
  3. Provide a server connection string to the server schema (domain) that contains your server tables.

JDBC Properties File Configuration Example

The following example configures a SAS JDBC driver properties file to connect to the server SNET process that is running at port 5401 on host myhost.unx.sas.com to access tables for a 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

set to SPD Server.

dbms_options

the server domain name (spdstmp), the server host name (myhost.unx.sas.com), and the port number (5400) assigned to the name server.

shareUser

the server user ID.

sharePassword

the server user password.

shareRelease

is set to V9.

jdbc:sharenet

the server SNET process host name and port number.

For more detailed information about JDBC connections for server data, see SAS 9.4 Drivers for JDBC Cookbook. Chapter 4 contains connection recipe information for accessing DBMS and SPD Server data.
Last updated: February 8, 2017