aspose file tools*
The moose likes JDBC and the fly likes steps to installing Oracle jdbc driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "steps to installing Oracle jdbc driver" Watch "steps to installing Oracle jdbc driver" New topic
Author

steps to installing Oracle jdbc driver

Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
I'm trying to write a servlet that will connect to an oracle database and display records. However for the past 2 weeks I've been stuck, and just can't seem to get it to work. Has anyone done this before?
I've installed the drivers from the cd with the oracle installer, set the classpath to point to the classes111.zip file, and set my path to point to the lib folder. Do I need to do anything else?
In my code, I've registered the driver with the line:
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()
When I compile, I get an error 302 - cannot access class oracle.jdbc.driver.OracleDriver
What have I forgotten to do?
Annette
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Try registering the driver using this:
Class.forName("oracle.jdbc.driver.OracleDriver");
instead of using the registerDriver() method.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
thanks!
that seemed to work. I'm using it in a servlet, so my next questions should probably go to the servlet forum.
Thanks again!
Annette
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
All drivers are written so they automatically instantiate themselves and then register themselves. All the Class.forName() does is load the specified class. The rest is done by the driver itself.
 
 
subject: steps to installing Oracle jdbc driver