• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Connectind DB2 from Java

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Hd Desai
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 39789
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Hd Desai
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

By mistake i wrote classpath.

I have included in Build path of WSAD only.But still its giving error as "ClassNotFoundException"
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!