Using Java Database Connectivity (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 an SPD Server connection string to the SPD Server schema (domain) that contains your SPD Server tables.

JDBC Properties File Configuration Example

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 is set to SPDS
  • 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.