Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package oracle.jdbc.driver does not exist

 
vikram malihan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers...
I'm using JAVA1.5 and "Oracle8i" as a data base and set the classpath and path to "classes12.zip" and "classes111.zip" in my jdbc program but it always give error on complilation "package oracle.jdbc.driver does not exist"

hare is code sample

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
^ // gives error at this pt
// Connect to the database
// You can put a database name after the @ sign in the connection URL.
Connection conn = DriverManager.getConnection ("jdbcracleci8:@", "scott", "tiger");

Thanks in advance

regards
 
Scott Selikoff
author
Saloon Keeper
Posts: 4032
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add ojdbc14.jar to the classpath too.
 
vikram malihan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot but it gives the same error
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15629
46
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you setting your classpath? You're most likely not setting the classpath correctly.
 
vikram malihan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tha code is given below

import java.sql.*;

class Employee
{
public static void main (String args [])throws SQLException
{
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection ("jdbcracleci8:@", "scott", "tiger");
Statement stmt = conn.createStatement ();

ResultSet rset = stmt.executeQuery ("select ENAME from EMP");

while (rset.next ())
System.out.println (rset.getString (1));

rset.close();
stmt.close();
conn.close();
}
}

CLASSPATH set is Read ".;G:\Oracle8i\jdbc\lib\ojdbc14.jar;G:\Oracle8i\jdbc\lib\classes12.zip;C:\Tomcat 5.0\common\lib\servlet-api.jar;E:\workspace\BruceEckal"

and PATH is "%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM;G:\Oracle8i\bin;D:\Program Files\Oracle\jre\1.1.7\bin;D:\Program Files\MySQL\MySQL Server 5.0\bin;G:\Oracle8i\jdbc\lib\classes12.zip;%JAVA_HOME%\bin"

i am using java1.5 and oracle8i
i have started oracle internal and startup myDb
but it always give error

E:\workspace\faltu>javac Employee.java
Employee.java:12: package oracle.jdbc.driver does not exist
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
^
1 error

Please guide me
 
vikram malihan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got the mistake
i was setting CLASS_PATH not "CLASSPTH"
now it is compiling but giving runtime error
E:\workspace\faltu>java Employee
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.
library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3135)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java
:3131)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:221)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
414)
at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:132)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtensio
n.java:78)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Employee.main(Employee.java:12)


what does these error means
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic