473,321 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Tomcat and DB2

I am trying to get connection pooling working with Tomcat 5.5 and DB2
v8.1. This was working under Websphere Studio Application Developer
5.x but we are trying to move onto Eclipse and Tomcat.

The datasources seem to get created correctly but I get an error when I
try to get the connection from the datasource:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class 'COM.ibm.db2.jdbc.app.DB2Driver' for connect URL
'jdbc:db2:mlmstrd1'
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.create DataSource(BasicDataSource.java:780)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getCon nection(BasicDataSource.java:554)

Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.jav a:243)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.create DataSource(BasicDataSource.java:773)
... 26 more
I've tried renaming the db2java.zip to db2java.jar and moving it to
common\lib. No matter what I try I get the same error.

Any help that anyone can give would be greatly appreciated.

Thanks,

Jon

Nov 12 '05 #1
12 12543
Hi Jon;
I had similar issues. I finally punted and put db2java.jar and
db2jcc.jar in both common\lib and the webapp's WEB-INF\lib directories.
Probably shouldn't need to do it, but it has corrected my problems.

Pete H

Nov 12 '05 #2
In article <11**********************@g44g2000cwa.googlegroups .com>,
(br****@gmail.com) says...
I am trying to get connection pooling working with Tomcat 5.5 and DB2
v8.1. This was working under Websphere Studio Application Developer
5.x but we are trying to move onto Eclipse and Tomcat.


The 'Database Web Server Software Installation Guide' at
http://tinyurl.com/8ekov might be able to help you.
Nov 12 '05 #3
I tried that as well. Still get the same error.

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class 'COM.ibm.db2.jdbc.app.DB2Driver' for connect URL
'jdbc:db2:bfstest'

Nov 12 '05 #4
For starters you must confirm that you can connect to DB2 from the
command line.

You may have to add a node for the bfstest database to the DB2 catalog.

Incase you're new to db2 the syntax is something like ...

For bfstesti is as the db2 instance,
and bfstest as the database,
and the server is mydb2server,
running on port 9100
db2 catalog tcpip node bfstesti remote mydb2server server 9100
db2 catalog db bfstest as bfstest at node bfstesti
br****@gmail.com wrote:
I tried that as well. Still get the same error.

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class 'COM.ibm.db2.jdbc.app.DB2Driver' for connect URL
'jdbc:db2:bfstest'


Nov 12 '05 #5
Given the error:
Cannot create JDBC driver of class 'COM.ibm.db2.jdbc.app.DB2Driver' for
connect URL
'jdbc:db2:bfstest'

This error has nothing to do with the database itself. You aren't even
getting that far yet. This error is telling you that java is unable to find
the ".app" driver. That driver exists in the "db2java.zip" file. Make sure
that that file exists (usually in "sqllib/java" directory) and that it is in
the CLASSPATH in the environment in which the app runs.

--
--------------------
Larry Menard
"Defender of Geese and of All Things Natural"
<gi*******************@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com... For starters you must confirm that you can connect to DB2 from the
command line.

You may have to add a node for the bfstest database to the DB2 catalog.

Incase you're new to db2 the syntax is something like ...

For bfstesti is as the db2 instance,
and bfstest as the database,
and the server is mydb2server,
running on port 9100
db2 catalog tcpip node bfstesti remote mydb2server server 9100
db2 catalog db bfstest as bfstest at node bfstesti
br****@gmail.com wrote:
I tried that as well. Still get the same error.

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class 'COM.ibm.db2.jdbc.app.DB2Driver' for connect URL
'jdbc:db2:bfstest'

Nov 12 '05 #6
I have copied the db2java.zip file into tomcat_home\common\lib and
tried it with .zip and .jar extensions. Neither have worked. I've
added the path to the file to the classpath in the Configure Tomcat
app.

Nov 12 '05 #7
Well, I can't tell you offhand why that didn't seem to help, but I am
quite confident that that is what the error means.

Make sure that the string you add to your CLASSPATH includes the file
name, not just the directory. E.g.,
"C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip", not just
"C:\PROGRA~1\IBM\SQLLIB\java".

--
--------------------
Larry Menard
"Defender of Geese and of All Things Natural"
<br****@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have copied the db2java.zip file into tomcat_home\common\lib and
tried it with .zip and .jar extensions. Neither have worked. I've
added the path to the file to the classpath in the Configure Tomcat
app.

Nov 12 '05 #8
In article <11**********************@f14g2000cwb.googlegroups .com>,
br****@gmail.com (br****@gmail.com) says...
I have copied the db2java.zip file into tomcat_home\common\lib and
tried it with .zip and .jar extensions. Neither have worked. I've
added the path to the file to the classpath in the Configure Tomcat
app.


Try unzipping the db2java.zip into tomcat_home\common\classes
It worked for me (credits to the sysinternals filemon tool).
Nov 12 '05 #9
I thought that would have worked but unfortunately I am still getting
the same error.

Nov 12 '05 #10
In article <11*********************@g14g2000cwa.googlegroups. com>,
br****@gmail.com (br****@gmail.com) says...
I thought that would have worked but unfortunately I am still getting
the same error.


Try to find out in which folder Tomcat is searching for the DB2
driver by starting filemon (download from
http://www.sysinternals.com/Utilities/Filemon.html and set the filter
on *tomcat*).
Nov 12 '05 #11
Thank you for that suggestion. The file monitor shows that it does
access tomcat_home\common\lib\db2java.jar. Now I am beginning to
think that I might need a new driver. Will let you know what I can
find.

Thanks again.

Jon
Gert van der Kooij wrote:
In article <11*********************@g14g2000cwa.googlegroups. com>,
br****@gmail.com (br****@gmail.com) says...
I thought that would have worked but unfortunately I am still getting
the same error.


Try to find out in which folder Tomcat is searching for the DB2
driver by starting filemon (download from
http://www.sysinternals.com/Utilities/Filemon.html and set the filter
on *tomcat*).


Nov 12 '05 #12
Tim
I would strongly suggest that you take a look at the DB2 JCC driver
too. This is a type 4 driver and doesn't require a DB2 client
installed on the server that's running the Java app and all that's
required to make a connection to a database is a URL, user name and
password.

There are two files that you'll need, db2jcc.jar and one of
db2jcc_license_cisuz.jar or db2jcc_license_cu.jar. In our case we
unjarred the jcc and license jar's and jarred them up again so we only
need to deploy one file. Making updates to the driver on the
application side is dead easy since you only need to drop in a new jar
file.

regards
tim

Nov 12 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: SamMan | last post by:
We are getting new computers at work and I got the word today that pc-lan (network admins) do not want IIS installed on ANY machine. We are primarily a Java development house, so they will not balk...
5
by: nmac | last post by:
Hi all, hopefully someone can offer some sagely advice regarding Production use of Jakarta's Tomcat. First, some brief background. My company have a servlet application that connects to a MySQL...
2
by: kimbuba | last post by:
Hi all, i'm writing cause i'm not able to find any good resources about this topic. I'm programming on tomcat and i have my browser open to see changes i made. The problem is that i'd like to see...
6
by: DaiIchi | last post by:
I'm using Tomcat in standalone mode. When a URL without a filename is entered into the browser (ie. "http://myhost.mydomain.com"), and the default path does NOT have an index.html, but rather an...
5
by: D E | last post by:
When using my web application manager (http://localhost:8080/admin) I forgot my password. Is there an XML file i can look at to remember/obtain (possibly even set). Thanks
3
by: danish | last post by:
hi everyone..sorry everyone if ive posted on the wrong group but i really needed help.... i wan tto start jakarta-tomcat-5.5.3 from the webbrowser using the sheel scripts...i normally use the...
4
by: Edward V. Berard | last post by:
People, I am having problems developing Java applications on a Mac using Eclipse, MyEclipse, and Tomcat 5.5+. My current configuration: Mac OS X (10.4.5) Eclipse (3.1+) MyEclipse (4.0+)
1
by: ashok2006 | last post by:
Hi everybody, Here is my problem:- When I start tomcat the command prompt for tomcat openes but closes within seconds. I've following environment varibles set:- CATALINA_HOME ...
0
by: Arun21084 | last post by:
Hi, Recently I installed an application HP SIP(Service Information Portal) on a Windows 2000 server.The application comes along with an installation of Tomcat 5.0.19. Already there was an Apache...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.