Tip

Configuring the JDBC Connector Service to perform database lookups

This Weblog describes how to activate the JDBC Connector Service in order to perform database lookups (without JDBC adapter) in XI. The standard how-to guide covers almost all steps but falls short in describing some configuration steps.
This weblog outlines the steps that are required to configure the JDBC Connector service for an Oracle database.
The following reference documents were used; this weblog explains the steps that were missed in those documents.

    Requires Free Membership to View

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9aedca11-0d01-0010-3b90-9ea04182875f
http://help.sap.com/saphelp_nw2004s/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/frameset.htm

Steps to configure JDBC connector service

1.Download the oracle JDBC driver ojdbc14.jar from the Web site
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
2.Use Visual Administrator to upload the ojdbc14.jar against the JDBC connector service.
3.Select the Service node from the list of nodes shown below.

4.Select the JDBC Connector from the list of services.

5.Place the cursor in the Drivers node in the Runtime tab. Click the create button to add the drivers.

6.Place the cursor in the DataSources to create a new data source.
Enter the following parameters
Application Name
Data source Name
Add alias name ( Do not add jdbc/Name)

since whatever name you add will be registered in the JNDI Registry under jdbc context, while writing the java code access the alias by (jdbc/aliasname).
Subsequently, to check if the alias is registered with JNDI, you can browse to the JNDI Registry node in Visual administrator and locate the alias.

Select the appropriate driver from the list of drivers (from step 5).
Select JDBC Version.
If the version is JDBC 2.0 compliant (Oracle 10.x drivers are compliant), then enter
Object factory - oracle.jdbc.pool.OracleDataSourceFactory
DataSource type – XADataSource
XADS Class name - oracle.jdbc.xa.client.OracleXADataSource

7.Select the additional tab to the enter parameters to connect to the database.
Enter the following parameters:
KeyValue
urljdbc:oracle:thin:@<hostname>:<listner portnumber>:<database name>
user<username to access the database>
password<password>

SQL Engine : Select Native SQL


8.How to test the data source to be sure it's working fine
In the DB initialization tab, enter a SQL statement to query the table, & press execute butto; it should return the results.
Do not forget to remove the statement after the test.

9.Develop Java code that performs DBLookup, the sample code for the performing the DBLook up is given in the How To Guide Appendix.
10.Follow the procedure as given in the how to guide to Create UDF's.

Varadharajan Krishnasamy is working for April Business Technology Consulting Pvt. Ltd.


This content is reposted from the SAP Developer Network.
Copyright 2007, SAP Developer Network

SAP Developer Network (SDN) is an active online community where ABAP, Java, .NET, and other cutting-edge technologies converge to form a resource and collaboration channel for SAP developers, consultants, integrators, and business analysts. SDN hosts a technical library, expert blogs, exclusive downloads and code samples, an extensive eLearning catalog, and active, moderated discussion forums. SDN membership is free.

Want to read more from this author? Click here to read Varadharajan Krishnasamy's Weblog. Click here to read more about SAP XI on SDN.



This was first published in March 2007

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.