Carolina S-JDBC Driver Usage

Driver class



jdbc:carolina:v2:libnames=(<list of directories >);

JDBC URL Examples


Username and Password

Some tools require entering username and password information when creating a connection using a JDBC driver. Carolina S-JDBC will ignore the values provided as the username and password, so providing any non-blank strings as the values will work.

Application Servers

Deploy a JDBC datasource based on sas7bdat files into any application container with support for JDBC DataSources and enable direct SAS data set file access from within your applications.

Deploy a JDBC datasource based on sas7bdat files into JBOSS or any other container with supporting JDBC DataSources

S-JDBC in JBoss

Database Productivity Tools

Extend the use of any database productivity tool such as Eclipse Database Development Platform or SQuirreL, capable of working with JDBC to working with SAS data sets in sas7bdat file format.

Working with sas7bdat files from Eclipse Database Tools Platform

S-JDBC in Eclipse Database Tools Platform

Create sas7bdat from Java

The example below shows how the S-JDBC Driver can be used from your Java application to create and write data to a SAS data set file directly. The file created by this example is stored as /home/demo/mydata1/event.sas7bdat.

Connection connection = DriverManager.getConnection(

try {
    Statement statement = connection.createStatement();
    statement.execute("CREATE TABLE data1.event " +
            "(e CHAR(5) label='Event Type', " +
            "n DOUBLE PRECISION, " +
            "d DATE, " +
            "t TIME, " +
            "dt TIMESTAMP)");
    PreparedStatement preparedStatement = connection.prepareStatement(
            "INSERT INTO data1.event (e, n, d, t, dt) " +
                    "VALUES (?, ?, ?, ?, ? )");
    preparedStatement.setString(1, "a");
    preparedStatement.setDouble(2, 10);
    preparedStatement.setDate(3, Date.valueOf("2014-02-28"));
    preparedStatement.setTime(4, Time.valueOf("05:27:43"));
    preparedStatement.setTimestamp(5, Timestamp.valueOf("2014-02-28 14:43:57.678"));

    preparedStatement.setString(1, "b");
    preparedStatement.setDouble(2, 11);
    preparedStatement.setDate(3, null);
    preparedStatement.setNull(4, Types.TIME);
    preparedStatement.setNull(5, Types.TIMESTAMP);

} finally {

Carolina S-JDBC Driver Documentation

Carolina S-JDBC documentation is available from our Documentation page