This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection to Database

 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the code snippet that u are using the connect to the database???
 
Joe Ess
Bartender
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic