Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2007
    Posts
    11
    Rep Power
    0

    Default 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
    Java 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());
    }}
    Java 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)....

  2. #2
    paty is offline Member
    Join Date
    Jul 2007
    Posts
    41
    Rep Power
    0

    Default

    Most probably "listener" (Oracle's miniserver) knows about some instances and does not know about others. Check the file "listener.ora". Add missing entries and restart "listener" by invoking lsnctrl.sh(small shell with several commands).
    Read docs on 'listener", "listener.ora" for more info.

  3. #3
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

  4. #4
    Daniel is offline Member
    Join Date
    Jun 2007
    Posts
    91
    Rep Power
    0

    Default

    Please check this code, please:

    Java 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("jdbc:oracle:thin:@localhost:1521:rcl","scott","tiger");
    
    System.out.println("--connected-->"+con.getClass());
    }}

Similar Threads

  1. Replies: 4
    Last Post: 03-31-2010, 01:08 PM
  2. Jdbc Driver For Oracle
    By Swamipsn in forum New To Java
    Replies: 0
    Last Post: 08-14-2007, 05:31 AM
  3. JDBC Driver problem
    By Swamipsn in forum New To Java
    Replies: 3
    Last Post: 08-09-2007, 04:55 PM
  4. Help with JDBC driver
    By Daniel in forum JDBC
    Replies: 2
    Last Post: 07-03-2007, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •