LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 07: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



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

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 03:35 PM.

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
Open Source Consulting | Domain Registration