Registering the Connector Class

Before connecting to your data, you must register the appropriate class for your application.

The following classes are used to connect the Simba Oracle Eloqua JDBC Connector to Eloqua data stores:

  • The CLJDBCDriver class extends java.sql.Driver.
  • The CLJDBCDataSource class extends javax.sql.DataSource and javax.sql.ConnectionPoolDataSource.

To support JDBC 4.2, classes with the following fully-qualified class names (FQCNs) are available:

  • com.simba.eloqua.jdbc42.CLJDBCDriver
  • com.simba.eloqua.jdbc42.CLJDBCDataSource

The following sample code shows how to use the DriverManager class to establish a connection for JDBC 4.2:

private static Connection connectViaDM() throws Exception

{

Connection connection = null;

connection = DriverManager.getConnection(CONNECTION_URL);

return connection;

}

The following sample code shows how to use the DataSource class to establish a connection:

private static Connection connectViaDS() throws Exception

{

Connection connection = null;

DataSource ds = new com.simba.eloqua.jdbc42.CLJDBCDataSource();

ds.setURL(CONNECTION_URL);

connection = ds.getConnection();

return connection;

}