This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JDBC and the fly likes Error in Database Connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Error in Database Connection" Watch "Error in Database Connection" New topic
Author

Error in Database Connection

Mohini Dhanaskar
Ranch Hand

Joined: Mar 27, 2012
Posts: 52
Hello Sir,

I am getting a following error while running an database connection code.

The code is



The error is run-main:

Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1400
    
    6

Have you set the required jar file in to the application class path?


Swastik
Mohini Dhanaskar
Ranch Hand

Joined: Mar 27, 2012
Posts: 52
Sir,i am running this code in NET beans.

So were should i placed jar files.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1400
    
    6

Mohini,

Go to project propreties->Libraries->Add jar/Folder and locate ojdbc14.jar.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3454
    
  47

You might also want to use a more recent Oracle JDBC driver, as explained here. That page also contains links to various version of Oracle JDBC drivers.
Mohini Dhanaskar
Ranch Hand

Joined: Mar 27, 2012
Posts: 52
Thanks a lot Swastik Sir and Martin Sir, my problem is solved.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1400
    
    6

You are most welcome Mohini.
Mohini Dhanaskar
Ranch Hand

Joined: Mar 27, 2012
Posts: 52
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in Database Connection
 
Similar Threads
java oracle conectivity
Oracle DBConnection Problem
class loader problem during connection of MySql driver
Cant connect to oracle.
exception while running my first jdbc code