Re: Oracle jdbc thin vs. oci tech questions

From: Alex Filonov <afilonov_at_pro-ns.net>
Date: Sat, 21 Jul 2001 21:12:33 GMT
Message-ID: <3B29857B.BAED0A5D_at_pro-ns.net>


md2100 wrote:

> I've had success using both oci and thin jdbc drivers to connect to
> remote Oracle databases. I cannot however use the thin driver to
> connect to a local (Personal Oracle 8i) db. I understand the fact
> that oci uses client-side libraries whereas the thin version is pure
> Java and connects using Java sockets. There are some issues I'm still
> unclear on though. Can someone help with these questions:
>
> (a) Why does the thin driver require a fully qualified URL in the
> connect string (eg: jdbc:oracle:thin:abc.efg.com:1521:_at_dbname) vs. the
> oci string (jdbc:oracle:oci:_at_dbname)? Is it because there's no local
> name resolution? If that's the case, is there any way to use Oracle
> name server to resolve the database name using the thin driver vs.
> having to have a fully qualified name hardcoded? Every example I've
> found of thin driver usage has the host and port hardcoded.
>

You don't need fully qualified string, you need any tcp/ip address your operating system can resolve.

>
> (b) Is the thin driver Java bytecode actually downloaded/used from the
> server in a Java application (vs. applet) or is it using the
> local-application's version of Oracle Java class library, eg.
> classes12.zip?
>

For the local application it uses classes12.zip, you should have it in your CLASSPATH.

>
> (c) Any idea why I can't connect to my Personal Oracle with the thin
> driver? I've set up the Net8 listener to 127.0.0.1 with port 1521 and
> used that as the address in the connect to no avai - I've also tried
> 'localhost'. In any case, I get the exception:
> Connection refused
> (DESCRIPTION=(TMP=)(VSNNUM=135294976)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))))
>
> I'm pretty much a newbie to the technical issues of this, so thanks in
> advance to help on any of these questions.

[oracle_at_Alex oracle]$ oerr ora 12505
12505, 00000, "TNS:listener could not resolve SID given in connect descriptor"

// *Cause:  The SID in the 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 INIT.ORA.
// *Comment: This error will be returned if the database instance has not
// registered with the listener; the instance may need to be started.


Looks like something wrong with your listener setup. Try to use Oracle netping to your instance to check connection to listener. Received on Sat Jul 21 2001 - 23:12:33 CEST

Original text of this message