
hi Below is the code of oracle database connectivity, when i compile it, it will show the error: oracle.jdbc.driver.OracleDriver I am using netbeans 6.5 and tomcat 6.0 and jdk 1.6 i have also set the environment variable like that .;E:\oracle\ora81\jdbc\lib\classes12.zip;E:\oracle\ora81\jdbc\lib\ojdbc14.zip;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;E:\oracle\ora81\jdbc\lib\classes111.zip
I am trying to solve the problem from last three to four week but still not success and still try
Please help me asap. Thanks in advance
package firstexample;
import java.sql.*;
public class FirstExample {
public static void main(String[] args) {
try {
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@//rajesh-4d3ad07c/1521:Rajesh", "scott", "tiger");
System.out.println("Connected");
Statement stmt = conn.createStatement();
// a select query
ResultSet rset = stmt.executeQuery ("SELECT ename FROM emp");
while (rset.next()) {
System.out.println("ENAME = " + rset.getString(1));
}
rset.close();
stmt.close();
conn.close();
} catch (Exception e) {
System.out.println("ERROR : " + e.getMessage());
}
}
}

please send the error message what comes and try with the another oracle jar version ojdbc14.jar and put the semicolon at the end of the line in classpath value.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.