10.07.2015 Views

JDBC Developer's Guide - Supra - Cincom

JDBC Developer's Guide - Supra - Cincom

JDBC Developer's Guide - Supra - Cincom

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Check the environment variablesIn addition to the standard <strong>Cincom</strong> ORDB client environment variables, youmust set the CLASSPATH to include your installed <strong>JDBC</strong> driver:%ORDB%/ordbjava.jarDetermining the version of the <strong>JDBC</strong> DriverIf at any time you need to determine the version of the <strong>JDBC</strong> driver that youinstalled, you can invoke the getDriverVersion() method of the <strong>JDBC</strong>DatabaseMetaData interface:// This example displays the version information about the <strong>Cincom</strong>ORDB <strong>JDBC</strong> Driverpackage demo.jdbc.samples;import java.lang.*;import java.sql.*;{class driverVersion {public static void main (String args []) throws SQLException// Load the <strong>Cincom</strong> ORDB <strong>JDBC</strong> driverDriverManager.registerDriver(new ordbjava.jdbc.ordbDriver());// connect to demodb as public userConnection conn =DriverManager.getConnection("jdbc:cincomordb:demodb","public",null);// Create <strong>Cincom</strong> ORDB DatabaseMetaData objectDatabaseMetaData meta = conn.getMetaData ();// gets driver info:System.out.println("<strong>Cincom</strong> ORDB <strong>JDBC</strong> driver version is " +meta.getDriverVersion());}conn.close();}<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 14Chapter: 2. Verifying a <strong>JDBC</strong> Driver installationSection: Check the environment variables

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!