Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection to oracle using jdbc 1

Status
Not open for further replies.

somdat

Programmer
Apr 24, 2003
3
0
0
IN
Hi, I am trying to connect to oracle database server from java using thin driver of Oracle via jdbc.I hv got jdk1.3.1_06 installed in my m/c and client version of oracle(Oracle 8.0.3.0.2).Since classes12.zip was not installed in my m/c i created a directory jdbc under oracle and installed the classes12.zip file there. I also changed the classpath variable in my m/c(Windows 2000 Server ) to reflect the presence classpath variable.but in spite of all that whenever I try to compile my java file it gives following error.

D:\JAVA_SOM\myConnection1.java:31: cannot resolve symbol
symbol : class OracleDriver
location: package driver
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

and this is the code that i wrote
--------------------------------------------------------

import java.sql.*;
import java.util.*;
import java.io.*;

public class myConnection1
{



public static void main(String args[])

{
Statement st;
Connection con;
ResultSet rs;



try
{

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
System.out.println("before");
con = DriverManager.getConnection("jdbc:eek:racle:thin:mad:204.170.59.3:1521:dossier","userwtc","dossier") ; st=con.createStatement();
System.out.println("Connected");


}
catch(Exception e){
System.out.println(e);
}


}





}
--------------------------------------------------

pls can somebody help me here
 
does your classpath include the actual classes12.zip file and not just the directory that it's in?

good:
classpath = '.....;...;C:/Oracle/jdbc/classes12.zip'

bad:
classpath = '.....;...;C:/Oracle/jdbc'

if this doesn't address your question...provide more info such as your path settings etc

Also...for a little redundancy..place this line of code before your DriverManager

Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();

ksolos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top