Hi iam recieving error for my code for JDBC please help me
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at jdbcstatements.JDBCConnection.main(JDBCConnection. java:17)
my code
package jdbcstatements;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class JDBCConnection {
public static void main(String[]args)
{
try {
Class.forName("oracle.jdbc.driver.OracleDriver").n ewInstance();
String url="jdbcracle:thin:@localhost:1521rcl";
Connection con=DriverManager.getConnection( url, "scott", "tiger");
System.out.println("connection created");
Statement db_statement = con.createStatement();
db_statement.executeUpdate
("create table employee { int id, char(50) name };");
con.commit();
ResultSet result = db_statement.executeQuery
("select * from employee");
while (result.next() )
{
// Use the getInt method to obtain emp. id
System.out.println ("ID : " + result.getInt("ID"));
// Use the getString method to obtain emp. name
System.out.println ("Name : " + result.getString("Name"));
System.out.println ();
}
} catch(Exception e){e.printStackTrace();}
}
}