By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,004 Members | 1,296 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,004 IT Pros & Developers. It's quick & easy.

Troubles using DB2, Websphere 3.5 and Java

P: 5
Hello partners.
I have some troubles trying to connect to a remote database from a Java Class.

I`m using the following code:

Expand|Select|Wrap|Line Numbers
  1. String DRIVER = "";
  3. String URL = "jdbc:db2://";
  5.    try
  6.    {
  7.       Class.forName(DRIVER);
  8.        }
  10.    catch(Exception ex)
  11.    {
  12.       System.out.println("Error");
  13.    }
  14. //more code
  15. .
  16. .
  17.      Connection con = DriverManager.getConnection(URL,"dbjj","dbjjk002");
  19. //more code
The problem is that the program can find the driver, but in the moment that tries to find the DB, I got a SQL exception: "No suitable Driver"

The driver used is I tried with db2jcc.jar and the license driver and it worked perfectly in my local host and local server, but I found that those drivers are not compatible with the JDK 1.2, used by the Websphere 3.5, and I got the horrible "Major minor exception". The big deal is that I need to make it work on that old Websphere.

The weird thing that I found is that when I try to contact the Database using Eclipse or my DB2 Client, I can do it without any problems, using the same IP, Port and DataBase name.

I hope I explain myself well. If any of you have some suggests or solutions, are well received. Or if you have an old DB2 driver for jdk 1.2, you will save my life.

Thank you all.
Jun 22 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.