Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DB2 connection

Status
Not open for further replies.

Kendel

Programmer
Apr 24, 2002
1,512
US
Hi,

I'm trying to connect to DB2 using java. Can someone please tell me what kind of setup I will need for the driver how to connect? I copied some examples I found but they didn't work.

Thanks.

-kendel
 
You just need to have the driver in the classpath.

What error are you getting?

Cheers,
Dian
 
Thanks. I guess I don't have the driver yet. Here is the error:

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

using:
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");

Ho do I setup the driver?
 
Looks like you're not providing the server name properly.

Can you show us the code where you stablish the connection'

Cheers,
Dian
 
Your database vendor should provide a JDBC driver - look in your db documentation or ask your DBA's for the driver - or your vendor.

Or search google for "DB2 JDBC driver" ...

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top