Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Posts
    2

    Unanswered: ORA-12545: Connect failed because target host or object does not exist

    Hi,

    When I try to connect Oracle (residing on a NT box) using sqlplus (sqlplus datarx_dev/datarx_dev@datarx) from the client installed on a Linux server I get connected to the Oracle instance.

    Now I tried to connect to Oracle using the following code in Java (JDK 1.3.1):
    import java.sql.*;

    public class OciConnTest
    {

    public static void main(String[] arg)
    {
    Connection conn = null;

    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");

    conn = DriverManager.getConnection("jdbcracleci8:@datarx", "datarx_dev", "datarx_dev");
    //conn = DriverManager.getConnection("jdbcracleci8:@tcgprod", "system", "manager");
    System.out.println("Connected");

    }catch(Exception e){
    System.out.println(e);
    }finally{
    try{
    conn.close();
    }catch(Exception ex){
    }
    }
    }
    }

    I get the following error:
    java.sql.SQLException: ORA-12545: Connect failed because target host or object does not exist

    Any help is appreciated.
    Last edited by dipsmyname; 09-04-02 at 01:34.

  2. #2
    Join Date
    Jul 2002
    Location
    India
    Posts
    1

    Re: ORA-12545: Connect failed because target host or object does not exist

    Hi,
    Please check whether Oracle is started when u r running this code. This error will be throwed only when oracle instance is not started and that the system is recornising the network. This error ORA-12545 is thrown when IP address is not found. so please check whether your system is connected to network. or what...

    cheers
    sastry

    Originally posted by dipsmyname
    Hi,

    When I try to connect Oracle (residing on a NT box) using sqlplus (sqlplus datarx_dev/datarx_dev@datarx) from the client installed on a Linux server I get connected to the Oracle instance.

    Now I tried to connect to Oracle using the following code in Java (JDK 1.3.1):
    import java.sql.*;

    public class OciConnTest
    {

    public static void main(String[] arg)
    {
    Connection conn = null;

    try{
    Class.forName("oracle.jdbc.driver.OracleDriver");

    conn = DriverManager.getConnection("jdbcracleci8:@datarx", "datarx_dev", "datarx_dev");
    //conn = DriverManager.getConnection("jdbcracleci8:@tcgprod", "system", "manager");
    System.out.println("Connected");

    }catch(Exception e){
    System.out.println(e);
    }finally{
    try{
    conn.close();
    }catch(Exception ex){
    }
    }
    }
    }

    I get the following error:
    java.sql.SQLException: ORA-12545: Connect failed because target host or object does not exist

    Any help is appreciated.

  3. #3
    Join Date
    Sep 2002
    Posts
    2

    Re: ORA-12545: Connect failed because target host or object does not exist

    Hi Sastry,

    Thanks for your reply. The Oracle instance is running, since we were able to connect to the Oracle instance (On NT) using SQL*Plus which was residing on Linux - the same machine where the java code resides. It would connect from SQL*Plus but not from the Java code.

    Thanks,
    -- Dipendra


    Originally posted by sastry
    Hi,
    Please check whether Oracle is started when u r running this code. This error will be throwed only when oracle instance is not started and that the system is recornising the network. This error ORA-12545 is thrown when IP address is not found. so please check whether your system is connected to network. or what...

    cheers
    sastry

Posting Permissions

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