jdbc connectivity
843859Mar 20 2008 — edited Mar 23 2008Hello Friends,
I am using Oracle10g as the database and jdk1.6.0, by the follwing code i am not able connect to the database and the exception at compline time is
unreported exception java.lang.classnotfoundexception; must be caught or declared to be thrown
Class.forName("oracle.jdbc.driver.OracleDriver");
import java.sql.*;
import java.lang.*;
import java.io.*;
public class db
{
public static void main (String args[]) throws SQLException
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin@localhost:1521:XE","SYSTEM","tiger");
System.out.println("connected");
}
}