Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

package oracle.jdbc.driver does not exist

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ("jdbc:oracle:oci8:@", "scott", "tiger");

Thanks in advance

regards
 
author
Posts: 4323
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Add ojdbc14.jar to the classpath too.
 
vikram malihan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot but it gives the same error
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ("jdbc:oracle:oci8:@", "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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Wanna see my flashlight? How about this tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic