aspose file tools*
The moose likes JDBC and the fly likes how to connect db2 with java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to connect db2 with java application" Watch "how to connect db2 with java application" New topic
Author

how to connect db2 with java application

Tausif Khanooni
Ranch Hand

Joined: Nov 14, 2002
Posts: 107
hi,
can some one give me the source code to know
how to connect the db2 database from java application
on windows environment.
i want to know all 4 drivers sample code and also
let me know what are the things (drivers) i have to
down load and classpath settings??
thnx in advance for ur help
cya
tausif


"Walking on water and building IT Architecture from <br />specification are easy if and only if both are frozen"
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
A good place to start is Sun's JDBC Drive Search page. You can search for any vendor who provides a DB2 driver, based on the type, the API version, etc. The site lists both free drivers and commercial products.
The results of the search will contain a URL to the driver page where you can download the driver. I've found that most downloads come with documentation and sample code that will help you get started.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by Tausif Khanooni:
hi,
can some one give me the source code to know
how to connect the db2 database from java application
on windows environment.
i want to know all 4 drivers sample code and also
let me know what are the things (drivers) i have to
down load and classpath settings??
thnx in advance for ur help
cya
tausif

Instead of me typing out a books worth of code and samples, you can go to here and download the JTOpen drivers for DB2. They work great. To connect, try the following ( after adding it to your classpath )

hope this helps,
Jamie
 
Consider Paul's rocket mass heater.
 
subject: how to connect db2 with java application