Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

confused about using JDBC in Web Services  RSS feed

 
Dan Walin
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not clear how / if Web Services are different than any other java application as far as reading from a DB2 table. Should I be able to just create a connection pool and use it just in a Web Service? I added a class called JDBCConnectionPool to the project. The code fails in the JDBCConnectionPool line:


The db2.driver being used is COM.ibm.db2.jdbc.app.DB2Driver (testing on my local machine first). I put the appropriate jar file for this driver in WEB-INF -> classes. I'm reading some things that seem to indicate you also need to add some things (data source, JDBC provider, etc) in the deployment descriptor. Am I heading in the wrong direction? Here's the code in my web service that is creating (trying to create) the connection pool. Thanks for any help you can provide.

 
Dan Walin
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved!

I moved the jar files to WEB-INF -> lib and it worked fine!
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37242
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan,
Thanks for posting the solution. I'm going to move this to our J2EE forum so people can find it when they have this problem in the future.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!