File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes How do I integrate a DB2 9.5 data source into WAS 6? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "How do I integrate a DB2 9.5 data source into WAS 6?" Watch "How do I integrate a DB2 9.5 data source into WAS 6?" New topic
Author

How do I integrate a DB2 9.5 data source into WAS 6?

Steffen E.
Greenhorn

Joined: Jan 09, 2009
Posts: 1
Hi,

I like to know I can integrate a DB2 9.5 data source into WebSphere Application Server - ND, 6.0.2.17 on a Solaris system.

My problem is that I get no connection but this exception:
com.ibm.db2.jcc.a.SqlException: DatabaseMetaData information is not known for server DB2/SUN64SQL09050 by this version of JDBC driver

I defined a new data source (new DB2, DB2 Universal JDBC Driver Provider, Connection pool data source) with this classpath:
${DB2_JDBC_9.5_DRIVER_PATH}
${DB2_JDBC_9.5_DRIVER_PATH}/db2cc.jar
${DB2_JDBC_9.5_DRIVER_PATH}/db2jcc_license_cu.jar
But nothing in the field “Native Library Path”.
Then I defined a new version 4 data source (required by my project). When I test the connection, WAS returns “successful”. But our application throws the exception above.

The problem seems to be that WebSphere includes old DB2 drivers by default. They overrule the new ones. It only works when I integrate the jars into my ear file and change the Class loader mode to "Parent Last". But this solution is not allowed for this application. So I search another solution.

Do I have to change the libraries that are loaded by this class loader: “WAS Bootstrap Extension Class Loader”?

I like to use the class loader mode "Parent First". When I view the class loaders (Enterprise Applications > My Application > my EJB > View Module Class Loader ) the order of the class loaders is JDK Extension Loader, JDK Application Class Loader, WAS Bootstrap Extension Class Loader, WAS Protection Class Loader.

WAS Bootstrap Extension Class Loader loads many libraries. Among them are those:
file:/opt/IBM/WebSphere/AppServer/lib/db2Interfaces.jar
file:/opt/IBM/WebSphere/AppServer/cloudscape/lib/db2j.jar
file:/opt/IBM/WebSphere/AppServer/cloudscape/lib/
file:/opt/IBM/WebSphere/AppServer/cloudscape/lib/db2jcc.jar
file:/opt/IBM/WebSphere/AppServer/cloudscape/lib/db2jcc_license_c.jar
file:/opt/IBM/WebSphere/AppServer/cloudscape/lib/db2jcview.jar
file:/opt/IBM/WebSphere/AppServer/cloudscape/lib/db2jnet.jar
file:/opt/IBM/WebSphere/AppServer/cloudscape/lib/db2jtools.jar
file:/opt/IBM/WebSphere/AppServer/cloudscape/lib/jh.jar
file:/opt/IBM/WebSphere/AppServer/cloudscape/lib/otherJars/db2cc.jar
file:/opt/IBM/WebSphere/AppServer/universalDriver/lib/db2jcc_license_cu.jar
I think that’s the problem. But I haven’t found out how I can change that.

Does someone know how I can change the libraries the WAS Bootstrap Extension Class Loader loads? Can anybody tell me a simpler solution to integrate DB2 9.5 datasources in WAS6?

Thanks in advance!

Kind regards,
Steffen
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Steffen, welcome to JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must contain your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names will be deleted."

As for your question, my version of Websphere (Windows) doesn't load any DB2 drivers by default. I have always configured that by putting the driver on the server and configuring the standard Websphere variable (DB2UNIVERSAL_JDBC_DRIVER_PATH) to point to the directory where I put it. I don't ever put the driver into my application.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How do I integrate a DB2 9.5 data source into WAS 6?
 
Similar Threads
java.sql.SQLException: No suitable driver
Class not found exception while creating datasource
EJB deployment problems
Error while defining class due to PARENT_FIRST class loader
WebSphere V6.1 Db2 V8.1 Connection Problem