LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices



Reply
 
Search this Thread
Old 06-28-2004, 08:13 PM   #1
proto_frosty
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.


Hello,

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

CODE:

import java.sql.*;
//import COM.ibm.db2.*;

public class JDBCtest{

public static void main(String[] args){

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

try{

System.out.println("Loading Driver");
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
System.out.println("Driver loaded");

try{

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

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

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

}

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

}

END CODE

In the same directory as this I have the contents of DB2Java.zip 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.
 
  


Reply


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 01:00 PM
how to get apache and tomcat work together chinaundead Programming 7 12-06-2004 11:33 PM
Suse 9.1 - Can't get Tomcat work aSimpleTux Linux - Software 1 09-28-2004 12:11 AM
Fedora Core 2 + Apache + Tomcat + JDBC paulecoyote Linux - Newbie 9 07-27-2004 07:58 PM
Getting MySQL to work with Tomcat Travis86 Linux - Software 3 07-15-2004 12:18 AM


All times are GMT -5. The time now is 02:30 AM.

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