jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes oracle.jdbc.driver.OracleDriver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "oracle.jdbc.driver.OracleDriver" Watch "oracle.jdbc.driver.OracleDriver" New topic


arunkumar hk

Joined: Mar 03, 2001
Posts: 5
I have a java program code is as below

import java.sql.*;
import java.io.*;
class demo
static Connection Con;
public static void main ( String [] str) throws Exception
Con = DriverManager.getConnection("jdbc racle:thin:@","scott","tiger");
Statement stmt = Con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tab");
catch( Exception e)
while executing i am getting the below error mesg, i have set the classpath and path correctly, pls tell the solution.

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at demo.main(demo.java:11)
Press any key to continue . . .

Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
The solution is to place your oracle driver in your classpath so that it can be found.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
arunkumar hk

Joined: Mar 03, 2001
Posts: 5
Thx for the reply, I have set the classpath, but still the problem exists it gives as
java.sql.SQLException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:411)
at oracle.jdbc.ttc7.TTCInBuffer.getByte(TTCInBuffer.java:94)
at oracle.jdbc.ttc7.TTIMsg.unmarshalSB1(TTIMsg.java:1085)
at oracle.jdbc.ttc7.O3log.receive2nd(O3log.java:603)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:168)
at oracle.jdbc.driver.OracleConnection.<init> (OracleConnection.java:103)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:148)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at demo.main(demo.java:12)
thx and rgds
Have you checked out Aspose?
subject: oracle.jdbc.driver.OracleDriver
It's not a secret anymore!