Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to connect db2 with java application

 
Tausif Khanooni
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic