permaculture playing cards
The moose likes JDBC and Relational Databases and the fly likes Connection to Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Connection to Database" Watch "Connection to Database" New topic

Connection to Database

Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
Hi All,
I've certain doubts abt JDBC...can anyone solve this?
1) While trying to connect to oracle database using type 4 driver, I'm getting following error
java.sql.SQLException: No suitable driver
I've set the classpath to, and even tried with
2) Suppose i've to connect from my machine to database which is installed on another machine. Is it necessary to install oracle client on my machine for type 1 driver? Is there any other way? How to create dsn for it?
3) How to connect with remote database using type 4 driver?
Nagendra Prasad
Ranch Hand

Joined: Jul 11, 2002
Posts: 219
Could you post the code snippet that u are using the connect to the database???

Best Regards,<br />Nagendra Prasad.
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

Oracle has some excelent documentation online:
Oracle Technology Network
What you want to know is in the JDBC Developer's Guide: here You have to register to view it, but it's worth it.
This code is the simplest possible Oracle JDBC app. It uses the Type 2 Server-side driver. Try to adapt it to your set up. Once you get it working you can see what your code is doing differently.

NOTE: The name of the driver was changed between Oracle 8 and 9. The above example works with Oracle 8.1.7.
[ October 31, 2003: Message edited by: Joe Ess ]

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Connection to Database
It's not a secret anymore!