Forums Register Login

Connectind DB2 from Java

+Pie Number of slices to send: Send
Hi,

I am trying to connect to Db2 7 From my java application.

I am using this driver
COM.ibm.db2.jdbc.app.DB2Driver

But its giving me exception like
java.sql.SQLException: No suitable driver

Pls help me in this regard.

Thanks
+Pie Number of slices to send: Send
Naik,
You are gettig this exception because the driver class is not visible to your java application.
Include the db2java.zip (present in the local machine) in the class path (if you are using WSAD, it is 'build path') of your application.

rgds,
Rangaraju.K
+Pie Number of slices to send: Send
Hi,

Thnx a lot for ur reply.

I have included db2java.zip in my classpath in WSAD.Still it is giving error.

IS there anything else we need to check?
+Pie Number of slices to send: Send
Naik,
You didn't mention (in your original post) that you were using WSAD -- WebSphere Application Developer, right?

WSAD doesn't use your CLASSPATH -- D'OH

Maybe someone who uses WSAD can tell you how to modify the CLASSPATH used by WSAD.

(Or is there something else you still haven't told us?)

Good Luck,
Avi.
+Pie Number of slices to send: Send
 

Originally posted by Avi Abrami:
Maybe someone who uses WSAD can tell you how to modify the CLASSPATH used by WSAD.


Each project has it's own classpath. I think the classpath Naik was referring to was the list of classpath variables. You need to update the build path for the project with the JDBC calls to include db2 as Ranga suggested.
+Pie Number of slices to send: Send
Hi,

By mistake i wrote classpath.

I have included in Build path of WSAD only.But still its giving error as "ClassNotFoundException"
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1073 times.
Similar Threads
Unexpected Exception
How I can connect DB2 to WSAD
quick question on DB2 JDBC encoding
DB2/WSAD
how to include db2jcc.jar and db2jcc_license_cu.jar (db2 driver) into my project
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:03:59.