Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: cannot contact database via JDBC thin driver but I can contact it via OCI driver

Re: cannot contact database via JDBC thin driver but I can contact it via OCI driver

From: Turkbear <john.g_at_dot.spamfree.com>
Date: Fri, 15 Oct 2004 11:11:12 -0500
Message-ID: <1097856611.2E0fkJfQ7RWM6M0utYdqkg@teranews>


Joe Weinstein <joeNOSPAM_at_bea.com> wrote:

>
>
>Cristian-Marius Vulpe wrote:
>
>> Hi!
>>
>> I have an Oracle 9.2.0 running on Solaris OS. I am trying to use a
>> JDBC application to contact the database, but I have the following:
>> - if I set the application to use the OCI driver (on the machine
>> where the Oracle is running) everything if fine.
>> - [the problem] if I try to use the thin driver (even if I start the
>> application on the same machine as the Oracle installation), I cannot
>> contact the database and I receive the following exception:
>
>Hi. If you can show the tnsnames.ora entry for the instance you want to reach,
>and show us the URL and arguments you send to the driver, we might see an
>error there. ALso, do you send the same user/password to the driver as you do
>SQL-PLUS?
>Joe Weinstein at BEA
>
>
>>
>> java.sql.SQLException: Io exception: Connection
>> refused(DESCRIPTION=(TMP=)(VSNNUM=153093120)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
>>
>> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
>>
>> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
>>
>> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
>>
>> at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3695)
>>
>> at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:352)
>>
>> at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:362)
>>
>> at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:536)
>>
>> at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:328)
>>
>> at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:124)
>>
>> at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.execute(OpenConnectionCommand.java:97)
>>
>> at net.sourceforge.squirrel_sql.client.mainframe.action.ConnectToAliasCommand$SheetHandler.run(ConnectToAliasCommand.java:368)
>>
>> at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
>>
>> at java.lang.Thread.run(Thread.java:534)
>>
>> Please notice that there is no firewall (this is valid for the remote
>> machines only), the TNS listener runs on 1521 port and I have the
>> following lines in "sqlnet.ora" file from "network/admin/" folder:
>>
>> # allow only specified nodes to access the database(s)
>> TCP.VALIDNODE_CHECKING = YES
>> TCP.INVITED_NODES = (<os_DNS_Name>, <my_IP_address>).
>>
>> Do you think you can help me with this topic (?) or please point me to
>> a documentation where I can find this topic.
>>
>> Many thanks,
>> cristi.
>>
>> PS: sorry if this is (maybe) the wrong place to put this question!

The error is a TNS one:



TNS-12505 TNS:listener could not resolve SID given in connect descriptor

Cause: The SID in CONNECT_DATA was not found in the listener's tables.

Action: Check to make sure that the SID specified is correct. The SIDs that are currently registered with the listener can be obtained by typing "LSNRCTL SERVICES listener_name". These SIDs correspond to SID_NAMEs in TNSNAMES.ORA, or DB_NAMES in the INIT.ORA file.



Check the sid spec in your conenct string ( the host:port:SID ) - Be sure it matches the instance you are trying to connect to.

hth, Received on Fri Oct 15 2004 - 11:11:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US