Iam using oracle10g at the backend.I tried a simple
JDBC program to check the jdbc connection with the database.
I have set the path for oracle bin folder in the System Variable "Path"
I have given the path for ojdbc14.jar file in the system variable "Classpath"
Here is the code.
import java.sql.*;
class TestConnection
{
public static void main(
String[] args)
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection ("jdbc: oracle: thin: @localhost: 8080
rcl","system","abhishek");
Statement stm=con.createStatement();
System.out.println("Connection established successfully");
con.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
The code compiled fine and raised an exception at runtime
java. lang. ClassNot FoundException: oracle. jdbc.driver. OracleDriver
at java. net. URLClass Loader$1.run (Unknown Source)
-------------------
at sql.OracleTest.main(OracleTest.java:11)
give the solution for this problem.thanks in advance