Hi,
I have a java program code is as below
import java.sql.*;
import java.io.*;
class demo
{
static Connection Con;
public static void main ( String [] str) throws Exception
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Con = DriverManager.getConnection("jdbc
racle:thin:@192.20.200.99:1521:demo","scott","tiger");
Statement stmt = Con.createStatement();
ResultSet rs = stmt.executeQuery("select * from tab");
while(rs.next())
{
System.out.println(rs.getString(1));
}
}
catch( Exception e)
{
e.printStackTrace();
}
}
}
while executing i am getting the below error mesg, i have set the classpath and path correctly, pls tell the solution.
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at demo.main(demo.java:11)
Press any key to continue . . .
rgds
arun.