wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes Connection Pooling in JBoss v5.0 with IBM DB2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Connection Pooling in JBoss v5.0 with IBM DB2" Watch "Connection Pooling in JBoss v5.0 with IBM DB2" New topic
Author

Connection Pooling in JBoss v5.0 with IBM DB2

damodaran puliyassery
Greenhorn

Joined: Dec 17, 2009
Posts: 13
I modify the db2-ds.xml file and put it in server/default/deploy folder.The file is


And in J2EE i write this code


But i got this error Message:- Error in DBConnection test not bound
I have to do any more changes?Why this error??Somebody please help......

thanks in advance....
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10067
    
163

By default the datasource will bind to java: namespace. So use java:test as the jndi name during the lookup. And remember that the java: namespace is visible only to clients running in the same JVM as the server where the datasource is deployed.

[My Blog] [JavaRanch Journal]
damodaran puliyassery
Greenhorn

Joined: Dec 17, 2009
Posts: 13
I use java:test in lookup.i copied the file db2java.jar to jboss<HOME>/server/default/lib folder.But i got this error while try to create connection.
I used the driver name as COM.ibm.db2.jdbc.app.DB2Driver.
Please help me...


Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
The error says you're using the wrong driver class for the url. What that means is the driver class, COM.ibm.db2.jdbc.app.DB2Driver (as you say in your message) doesn't work with the connection url you have specified in the datasource descriptor, jdbc:db2://localhost:50000/dbinventory.

It's been a long time since I worked with DB2, so unless someone can give you better help here, you'll need to look up the JDBC driver help provided by IBM and see what they say. They should include examples of how to configure the datasource properly.

In looking at the xml file you provided, I did notice two things. First, the driver class specified in the file is different from the one specified in the commented instructions in the file - one uses com while the other uses COM. Are you sure you have that correct.
Secondly, it seems the URL format is different for the different types of drivers. Again, read through the documentation and make sure you're using all the correct configuration information for the drive you wish to use.

I hope this helps,
 
wood burning stoves
 
subject: Connection Pooling in JBoss v5.0 with IBM DB2