![]() |
VOOZH | about |
The CData JDBC driver for Oracle Eloqua Reporting is easy to integrate with Java Web applications. This article shows how to efficiently connect to Oracle Eloqua Reporting data in Jetty by configuring the driver for connection pooling. You will configure a JNDI resource for Oracle Eloqua Reporting in Jetty.
Follow the steps below to connect to Salesforce from Jetty.
Enable the JNDI module for your Jetty base. The following command enables JNDI from the command-line:
java -jar ../start.jar --add-to-startd=jndi
Declare the resource and its scope. Enter the required connection properties in the resource declaration. This example declares the Oracle Eloqua Reporting data source at the level of the Web app, in WEB-INF\jetty-env.xml.
<Configure id='eloquareportingdemo' class="org.eclipse.jetty.webapp.WebAppContext"> <New id="eloquareportingdemo" class="org.eclipse.jetty.plus.jndi.Resource"> <Arg><Ref refid="eloquareportingdemo"/></Arg> <Arg>jdbc/eloquareportingdb</Arg> <Arg> <New class="cdata.jdbc.oracleeloquareporting.OracleEloquaReportingDriver"> <Set name="url">jdbc:oracleeloquareporting:</Set> <Set name="AuthScheme">Basic</Set> <Set name="User">user</Set> <Set name="Password">password</Set> <Set name="Company">MyCompany</Set> </New> </Arg> </New> </Configure>
Oracle Eloqua Reporting supports the following authentication methods:
To perform authentication with a user and password, specify these properties:
To authenticate with the OAuth code grant flow, you must set AuthScheme to OAuth and create a custom OAuth application. For information about how to create a custom OAuth application, see the Help documentation.
Then set the following properties:
When you connect, the driver opens Oracle Eloqua Reporting's OAuth endpoint in your default browser. Log in and grant permissions to the application. When the access token expires, the driver refreshes it automatically.
With the OAuth password grant flow, you can use your OAuth application's credentials alongside your user credentials to authenticate without the need to grant permission manually via a browser prompt. You must create an OAuth app (see the Help documentation) to use this authentication method.
Set the following properties:
Configure the resource in the Web.xml:
jdbc/eloquareportingdb javax.sql.DataSource Container
You can then access Oracle Eloqua Reporting with a lookup to java:comp/env/jdbc/eloquareportingdb:
InitialContext ctx = new InitialContext();
DataSource myeloquareporting = (DataSource)ctx.lookup("java:comp/env/jdbc/eloquareportingdb");
The steps above show how to configure the driver in a simple connection pooling scenario. For more use cases and information, see the Working with Jetty JNDI chapter in the Jetty documentation.
Download a free trial of the Oracle Eloqua Reporting Driver to get started:
Download NowLearn more:
👁 Oracle Eloqua Reporting IconRapidly create and deploy powerful Java applications that integrate with Oracle Eloqua Reporting.