JDBC driver connection problem
When I execute the below program I am getting the following error please help me..I have set class path to ojdbc14.jar also.. please help
Code:
import java.sql.*;
public class Con2{
public static void main(String a[]) throws Exception{
Driver drv=new oracle.jdbc.driver.OracleDriver();
DriverManager.registerDriver(drv);
System.out.println("h");
Connection con=DriverManager.getConnection("jdbcracle:thin:@localhost:1521rcl","scott","tiger");
System.out.println("--connected-->"+con.getClass());
}}
Code:
Exception in thread "main" java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:125)....