oracle.jdbc.driver.OracleDriver() problem

Hi guys. I am taking a dbsystems class at school. We are required to connect to the schools oracle db using this package: oracle.jdbc.driver

the code provided by the profesor is meant to be used by logging into unix accounts on the schools servers and running our java programs remotely. I've been trying to connect by running the java program localy.

i'm using netbeans 4, with java5. netbeans tells me that this oracle.jdbc.driver package doesn't exist.

here is the connection part of the code:

//create the oracle driver

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

//create a connection object

Connection conn = DriverManager.getConnection("jdbc:oracle:oci:@<blahblahblah>", "<myusername>", "<mysuperduperprivatepassword>");

I have followed many forums and threads on the web. Most of them seem to be fixed just by renaming the classes12.zip file to .jar, placing them in the jre/lib folder and setting the path, but they all seem to be running the java program on the same computer as the database, where as i'm trying to connect remotely. i still tried following the instructions, and this still hasn't worked for me. so, my question is, will this even work since i am trying to connect remotely? and if not, how can i connect remotely to a database using only java? thanks

gyro

[1392 byte] By [Gyro-equals-new-trojanHorse] at [2007-9-30 20:02:58]
# 1

I haven't used NetBeans, but you need to make sure that classes12.zip is in the build path for your project so that NetBeans can find it. NetBeans might include it's own JDK so putting it into another JRE's lib/ext folder not used by NetBeans will not work.

There's no need to convert classes12.zip to a jar. I have used classes12.zip for several years as is when connecting to Oracle 8 databases.

To use the Oracle Call Interface (OCI), you will need to have the Oracle client software installed on the computer where you are running the Java program. You might want to consider changing the URL to use the thin driver unless OCI is the way you are supposed to go.

cknelsen at 2007-7-7 0:49:22 > top of Java-index,Administration Tools,Sun Connection...
# 2

when you say build path, do u mean the same folder as my .java source? because it is. I don't know if u need to know this, but it will compile, but not run, and then it will print the above mentioned error. but in netbeans, it just tells you ahead of time why it wont run if u try to run it.

anyways, from what i understand from what u wrote, i will need to use the thin driver...now that comes with the oracle.jdbc.driver package, but i just need to use a different call, right? like, instead of oracle.jdbc i would need oracle.thin, is this what u mean? and if it doesn't contain the thin driver, where can i find it? i found it onces before, but that was completely by accident. can someone supply a url? thanks

jay

Gyro-equals-new-trojanHorse at 2007-7-7 0:49:22 > top of Java-index,Administration Tools,Sun Connection...
# 3
wherever the .class files placed, in that system classpath put the classes12.zip file. This works fine.
glrao at 2007-7-7 0:49:22 > top of Java-index,Administration Tools,Sun Connection...
# 4

Hi

The URL should be "jdbc:oracle:thin:@<OracleServer>:<port>:<SID>

Example : jdbc:oracle:thin:@123.45.678.90:1521:ORCL where 123.45.678.90 is the IP address of the machine where ORacle Server is running. It can be a machine name also. The port number 1521 is the default one unless you change that during Oracle installation. Database name is equivalent to SID and that is ORCL in most cases.

Hope this helps.

Thanks

Srini

Srinivas-Guda at 2007-7-7 0:49:22 > top of Java-index,Administration Tools,Sun Connection...
# 5
make sure the driver library i.e. the .jar file eg. oracle.jar is included in the classpath also make sure u use the correct oracle url. Include the full path of the jar file in env. variable CLASSPATH or use it as argument to javac/java
raju123 at 2007-7-7 0:49:22 > top of Java-index,Administration Tools,Sun Connection...