This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes Connection to Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection to Database" Watch "Connection to Database" New topic
Author

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 classes12.zip, and even tried with classes111.zip
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?
TIA
Grishma
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
Bartender

Joined: Oct 29, 2001
Posts: 8877
    
    8

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 ]

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection to Database