Results 1 to 5 of 5

Thread: JDBC Connection

  1. #1
    Join Date
    Dec 2003
    Posts
    7

    Unanswered: JDBC Connection

    I'm using JDBC to connect to the database in a java application that is running in the same machine where
    the database is installed.
    My URL is typically : "jdbcracle:thin:<user>/<password>@<host>:1521:<sid>"
    If the host I put the IP, or the logical name, the connection works fine. If I put localhost I get the error:
    "java.sql.SQLException: Io exception: The Network Adapter could not establish the connection"

    The IP of the machine changed... is anything to do with that.

    My listener file is:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = <IP>)(PORT = 1521))
    )
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    )
    )

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /opt/oracle/product/10.1.0/Db_1)
    (PROGRAM = extproc)
    )
    (SID_DESC =
    (GLOBAL_DBNAME = orcl)
    (ORACLE_HOME = /opt/oracle/product/10.1.0/Db_1)
    (SID_NAME = orcl)
    )
    )

    The Oracle is 10g.

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool


    Check out your /etc/hosts file.

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Dec 2003
    Posts
    7
    The file is fine.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >The file is fine.
    If it were REALLY fine, you would NOT be getting any error!
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Jun 2003
    Location
    Sydney, Australia
    Posts
    66
    in the Jdbc Url, try using 127.0.0.1 as the IP address of the server. That is the same as "localhost" but is guaranteed to resolve.

    Also, very old Oracle c lient software was using a different, m ore efficient way to connect to a server on the local machine ( in compariso to remote machines). Try something like @2 instead of the host in your URL. It may work, but I assume the pure-Java driver uses the same kind of TCP connection, whether the server is remote or local.

Posting Permissions

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