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
- String DRIVER = "COM.ibm.db2.jdbc.app.DB2Driver";
- String URL = "jdbc:db2://200.33.154.10:50200/BAFBP001";
- try
- {
- Class.forName(DRIVER);
- }
- catch(Exception ex)
- {
- System.out.println("Error");
- }
- //more code
- .
- .
- Connection con = DriverManager.getConnection(URL,"dbjj","dbjjk002");
- //more code
The driver used is DB2Java.zip. 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.