This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Connecting Java with Oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connecting Java with Oracle" Watch "Connecting Java with Oracle" New topic

Connecting Java with Oracle

besian hoxha

Joined: May 21, 2012
Posts: 3

I'm trying to connect with Oracle but there are some problem..
Can anyone help me please?

There is the code:


ConnectOracle@130c19b databaseoracle
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at ConnectOracle.getOracleConnection(
at ConnectOracle.getConnection(
at ConnectOracle.getModeli(
at ConnectOracle.main(
at ConnectOracle.getModeli(
at ConnectOracle.main(

[Added code tags - see UseCodeTags for details]
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
Did you get the jar file containing the oracle connection driver and put it in your classpath?
It seems you didn't.

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38045
I think this thread would sit better in the databases forum (connections probably fit better there than in the Oracle forum). Moving discussion.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860

Nicola is correct.

Class.forName() will look in the $CLASSPATH/%CLASSPATH% of the application server at run-time.

Either include the oracle supplied jar in your web-inf/lib or install in the appservers shared lib folders.

Martin Vajsar

Joined: Aug 22, 2010
Posts: 3606

If needed, you can find links to Oracle JDBC drivers, as well as other useful Oracle related advice, in our Oracle FAQ page.
Consider Paul's rocket mass heater.
subject: Connecting Java with Oracle
Similar Threads
type 4 driver with oracle 9i
Cant connect to oracle.
Oracle DBConnection Problem
java oracle conectivity