Hi Everyone,
I am getting a really strange error. I am using jdk 131._09 and the code compiles and runs when i run using eclipse in a windows xp professional box. I am using the
java code to connect to a DB2 database using COM.ibm.db2.jdbc.app.DB2Driver. I am using version 9.1 of DB2 client from my system.
However, when i try running the same program in a solaris OS environment with latest db2 classes, I hit the No suitable Driver error.
On comparing the drivers, I noted the drivers I used for my local enviroment was 1.3 megs and the one in /opt/ibm/db2/java/db2java.zip to be 850 kb.
Though i do NOT have rights to modify files in the above folder, I tried appending the my client driver to the classpath at runtime using :
java -cp :/www/a/bi603/core/classes/test:/opt/IBM/db2/V9.1/java/db2java.zip TestDB2Conn
and it dosen't seem to override and still see the no suitable driver message. If i echo the classpath, I see the path to my custom driver.
I also tried another thing...Copying over the db2 driver from solaris box to my local environment. Then while running it says, "could not find main, program will exit in eclipse " and displays the following trace
java.lang.NoSuchMethodError
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(Unknown Source)
at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:115)
at TestDB2Conn.<clinit>(TestDB2Conn.java:19)
Exception in
thread "main"
Can anyone suggest what is going wrong here ? I know there is a driver mismatch. What else can i do to resolve this ?
Do I really have to involve the DB2 admin to replace the exisiting 850 kb drivers under java folder with those (1.3 megs) in my client system ?
Please advice
Thanks
Arati