This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes DB2 Connection error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "DB2 Connection error" Watch "DB2 Connection error" New topic
Author

DB2 Connection error

Nils Persson
Greenhorn

Joined: May 25, 2001
Posts: 21
I get the following error when I try to run my servlet, trying to connect to a DB2 database.

I have also tried net insted of app.
I use Tomcat 4.
I have the db2java.zip file in my classpath. Does Tomcat have its own classpath?
Should I put something in web.xml or server.xml?
Monty Ireland
Ranch Hand

Joined: Oct 03, 2000
Posts: 161
My client has had simular errors about a month ago.
Need more information:
What version of java are you using?
What version of jdbc are you using?
What platform is you client running on?
What platform is db2 running on?
I check back in an hour or so?


Multi Platform Database Developer & DBA on E.S.T.
Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
I think ur dsn name is not suitable for ur connection.Just u create new dsn name and test it .this is my advice only...
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Quick fix: rename the .zip to .jar and put it in the [ TOMCAT_HOME ]/common/lib directory.
Yes, Tomcat maintains its own 'classpath' (it actually has multiple ClassLoaders to manage borders between applications) and can automatically load archives. The problem with loading these archives is that it will only load jars and not zip files.
What you should do is rename it .jar and put it in the [ TOMCAT_HOME ]/webapps/[ CONTEXT ]/web-inf/lib directory. The difference is that the original fix will make it available to ALL web apps, the second will only make it available to a single web app. The second is the preferred solution.
Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DB2 Connection error