Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002

    Unhappy Unanswered: JDBC: error 12505 Connection refused

    Can anyone explain the reason why I get this error:

    java.sql.SQLException: Io-exception: Connection refused(DESCRIPTION=(TMP=)(VSNN
    UM=150999297)(ERR=12505)(ERROR_STACK=(ERROR=(CODE= 12505)(EMFI=4))))

    The error arises on attempt to connect to an Oracle 9i database using an Oracle thin driver.

    The java code looks like this:

    DriverManager.registerDriver( new oracle.jdbc.driver.OracleDriver() );
    String url = "jdbcracle:thin:@orakur01:1521lga";
    String bruger = "scott";
    String pwd = "tiger";
    Connection conn = DriverManager.getConnection( url, bruger, pwd );

    The matching TNSNAMES.ORA entry looks like this:

    OLGA =
    (ADDRESS = (PROTOCOL = TCP)(HOST = orakur01)(PORT = 1521))

    The strange thing is that if I use the url "jdbcracle:thin:@orakur01:1521lga", the connection hangs, whereas using the url "" I get the error message.

    I will be most grateful for your help.
    Best regards

  2. #2
    Join Date
    Aug 2003
    I had the same problem and it drove me nuts.
    I use win xp and I fixed as follows : I installed the correct DSN in the SYSTEM DSN tab on ODBC data sources...
    (start - control panel - admin tools - data sources(ODBC) - SYSTEM DSN tab)
    Then select add (use the oracle driver) then followed the prompts.
    After the system dsn was installed my query worked!! The connection string must inlude the port (1521) and data base gdn name at the end.
    I was accessing my database remotely (intranet) via web browser.
    Hope this helps.

  3. #3
    Join Date
    Mar 2002
    Reading, UK
    Its not to do with ODBC but with the connection string. You should specify the Oracle SID not the service name. Check with your DBA what the SID value is set to. If it still doesnt work make sure you can make a connection using sqlplus from your machine.


Posting Permissions

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