![]() |
VOOZH | about |
The CData JDBC driver for SAP Ariba Procurement is easy to integrate with Java Web applications. This article shows how to efficiently connect to SAP Ariba Procurement data in Jetty by configuring the driver for connection pooling. You will configure a JNDI resource for SAP Ariba Procurement 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 SAP Ariba Procurement data source at the level of the Web app, in WEB-INF\jetty-env.xml.
<Configure id='saparibaprocurementdemo' class="org.eclipse.jetty.webapp.WebAppContext"> <New id="saparibaprocurementdemo" class="org.eclipse.jetty.plus.jndi.Resource"> <Arg><Ref refid="saparibaprocurementdemo"/></Arg> <Arg>jdbc/saparibaprocurementdb</Arg> <Arg> <New class="cdata.jdbc.saparibaprocurement.SAPAribaProcurementDriver"> <Set name="url">jdbc:saparibaprocurement:</Set> <Set name="ANID">AN02000000280</Set> <Set name="API">PurchaseOrdersBuyerAPI-V1</Set> <Set name="APIKey">wWVLn7WTAXrIRMAzZ6VnuEj7Ekot5jnU</Set> <Set name="AuthScheme">OAuthClient</Set> <Set name="InitiateOAuth">GETANDREFRESH</Set> </New> </Arg> </New> </Configure>
In order to connect with SAP Ariba Procurement, set the following:
After setting connection properties, you need to configure OAuth connectivity to authenticate.
For more information on creating an OAuth application, refer to the Help documentation.
After setting the following, you are ready to connect:
When you connect, the provider automatically completes the OAuth process:
Configure the resource in the Web.xml:
jdbc/saparibaprocurementdb javax.sql.DataSource Container
You can then access SAP Ariba Procurement with a lookup to java:comp/env/jdbc/saparibaprocurementdb:
InitialContext ctx = new InitialContext();
DataSource mysaparibaprocurement = (DataSource)ctx.lookup("java:comp/env/jdbc/saparibaprocurementdb");
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 SAP Ariba Procurement Driver to get started:
Download NowLearn more:
👁 SAP Ariba Procurement IconRapidly create and deploy powerful Java applications that integrate with SAP Ariba Procurement.