Share your knowledge at the LQ Wiki.
Go Back > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.


  Search this Thread
Old 06-28-2004, 07:13 PM   #1
LQ Newbie
Registered: Sep 2003
Location: Portsmouth, England
Distribution: Slackware & Lindows
Posts: 3

Rep: Reputation: 0
Unhappy JDBC with Tomcat and DB2 just won't work.


I'm trying to get Tomcat 4.1.24 to talk to DB2 v7.1, this is all running on a virtual suse box (9.1). They're letting me use Tomcat instead of Websphere but I still have to use DB2. At least its linux

I feel Tomcat isn't to blame as I can't get it to work from a normal java programq and Tomcat is setup correctly and serves non JDBC JSPs fine. This is what I'm trying to run, its just too lines really witha lot of error checking


import java.sql.*;

public class JDBCtest{

public static void main(String[] args){

System.out.println("Starting test");


System.out.println("Loading Driver");
System.out.println("Driver loaded");


System.out.println("Getting connection");
Connection databaseConnection = DriverManager.getConnection("jdbc:db2:eventod","db2inst1","*******");
System.out.println("Connection obtained - about to close it");
System.out.println("Connection closed");

}catch(Exception e){
System.out.println("<br>Had an error on line 2!!!");
}catch(Exception e){

System.out.println("<br>Had an error on line 1!!!");


System.out.println("Test endded");



In the same directory as this I have the contents of which came from the DB2 install. The drive loads but when I try to make a connection I get an error 'Driver not suitable'. The database 'eventod' exists and I can run sql against it from the DB2 command promt. I have no idea whats wrong.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
installing java (trying to get tomcat to work) twistedrhymes Linux - Software 1 07-03-2005 12:00 PM
how to get apache and tomcat work together chinaundead Programming 7 12-06-2004 10:33 PM
Suse 9.1 - Can't get Tomcat work aSimpleTux Linux - Software 1 09-27-2004 11:11 PM
Fedora Core 2 + Apache + Tomcat + JDBC paulecoyote Linux - Newbie 9 07-27-2004 06:58 PM
Getting MySQL to work with Tomcat Travis86 Linux - Software 3 07-14-2004 11:18 PM > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 05:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration