473,654 Members | 3,062 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.tomc at.dbcp.dbcp.SQ LNestedExceptio n: Cannot create JDBC
driver of class 'COM.ibm.db2.jd bc.app.DB2Drive r' for connect URL
'jdbc:db2:mlmst rd1'
at
org.apache.tomc at.dbcp.dbcp.Ba sicDataSource.c reateDataSource (BasicDataSourc e.java:780)
at
org.apache.tomc at.dbcp.dbcp.Ba sicDataSource.g etConnection(Ba sicDataSource.j ava:554)

Caused by: java.sql.SQLExc eption: No suitable driver
at java.sql.Driver Manager.getDriv er(DriverManage r.java:243)
at
org.apache.tomc at.dbcp.dbcp.Ba sicDataSource.c reateDataSource (BasicDataSourc e.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 12574
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************ **********@g44g 2000cwa.googleg roups.com>,
(br****@gmail.c om) 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.tomc at.dbcp.dbcp.SQ LNestedExceptio n: Cannot create JDBC
driver of class 'COM.ibm.db2.jd bc.app.DB2Drive r' for connect URL
'jdbc:db2:bfste st'

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.co m wrote:
I tried that as well. Still get the same error.

org.apache.tomc at.dbcp.dbcp.SQ LNestedExceptio n: Cannot create JDBC
driver of class 'COM.ibm.db2.jd bc.app.DB2Drive r' for connect URL
'jdbc:db2:bfste st'


Nov 12 '05 #5
Given the error:
Cannot create JDBC driver of class 'COM.ibm.db2.jd bc.app.DB2Drive r' for
connect URL
'jdbc:db2:bfste st'

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.zi p" 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.c om> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.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.co m wrote:
I tried that as well. Still get the same error.

org.apache.tomc at.dbcp.dbcp.SQ LNestedExceptio n: Cannot create JDBC
driver of class 'COM.ibm.db2.jd bc.app.DB2Drive r' for connect URL
'jdbc:db2:bfste st'

Nov 12 '05 #6
I have copied the db2java.zip file into tomcat_home\com mon\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\IB M\SQLLIB\java\d b2java.zip", not just
"C:\PROGRA~1\IB M\SQLLIB\java".

--
--------------------
Larry Menard
"Defender of Geese and of All Things Natural"
<br****@gmail.c om> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I have copied the db2java.zip file into tomcat_home\com mon\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************ **********@f14g 2000cwb.googleg roups.com>,
br****@gmail.co m (br****@gmail.c om) says...
I have copied the db2java.zip file into tomcat_home\com mon\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\com mon\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

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

Similar topics

4
7404
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 about me installing Tomcat. Can I run PHP from Tomcat the same (or close to) as IIS? Thanks. --
5
4027
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 database. The servlet is deployed on two seperate win2k servers (Access to the tomcat servers is via DNS round robin load balancing). The database is on a another win2k server.
2
9504
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 changes immediatly, is there a way to do this, but using start-stop-reload from tomcato manager admin? I tried to add this to server.xml <Context path="/info" docBase="info" debug="0" reloadable="true">
6
12133
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 index.jsp file, Tomcat response with an "HTTP/1.1 302 Moved Temporarily" and a "Location: http://myhost.mydomain.com/index.jsp" ... I was wondering if there is a configuration for tomcat that can stop this behavior, i.e., just run index.jsp?
5
37992
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
2838
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 shell scripts from the command line to start and stop the tomcat server..... i found out that php gives this incredible facility where i can execute normal bash commands...i tried doing so ..but a simple command like { system('whoami') } from
4
13595
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
2932
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 C:\jakarta-tomcat-4.1.31 JAVA_HOME C:\j2sdk1.4.2 Path %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\J2SDK1.4.2\BIN;C:\Sun\AppServer\bin
0
4199
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 2 running on the server used by other application. Once after installation of the product(HP SIP), I tried to restart the Tomcat 5.0.19 process using below methods(errors reported below respectively) 1) services.msc console Could not start...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8707
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.