This is an old revision of the document!


Using the JDBC Interface

Connecting to an Omnidex enhanced database through the Omnidex JDBC driver is the same as connecting to any other database using any other JDBC driver, with two notable exceptions:

  • The Omnidex JDBC driver must be loaded and registered with java.sql.DriverManager.
  • The connection url must point to an Omnidex Generic data source.

The java.sql classes must be imported into the Java program along with any other desired Java packages. This is because the java.sql.DriverManager is used to register the Omnidex JDBC driver. Also, the Omnidex JDBC classes throw java.sql.SQLExceptions.

import java.sql.*;

The following code snippet will load the Omnidex JDBC driver and register it with the java.sql.DriverManager. This ensures that the Omnidex JDBC driver will be used for all subsequent connections.

Class.forName("omnidex.jdbc.OdxJDBCDriver");
// Pass the connection url to the DriverManager class to obtain a connection.
Connection conn = DriverManager.getConnection(
"jdbc:omnidex:c:\\odxtesting\\dsn\\odx_file_ordersffl.dsn");

All of the Omnidex JDBC Driver classes implement the java.sql classes and inherit all of the constructors, methods and properties. The Omnidex JDBC classes also contain some additional methods and properties specific to Omnidex.

 
Back to top
dev/jdbc/home.1258591125.txt.gz ยท Last modified: 2016/06/28 22:38 (external edit)