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: How to do a local connection with JDBC ?

Re: How to do a local connection with JDBC ?

From: jodetek <jodetek_at_free.fr>
Date: Sat, 15 Jan 2005 01:05:52 +0100
Message-ID: <41e85e57$0$31534$626a14ce@news.free.fr>


yes, I didn't change the ORACLE_SID during the test

I believe it is a bug in IBM's Java 1.3.1 because it's working with 1.3.0

However, the Oracle documentation is unclear about local connection versus network connection

I would like to make sure about the way to connect a database locaaly on the server.

JD

"Antoine BRUNEL" <antoinebrunel_at_nospam_yahoo.fr> a écrit dans le message de news: 41e84d5b$0$29380$79c14f64_at_nan-newsreader-05.noos.net...
> Hi from Paris
>
> are you sure the ORACLE_SID variable is the same you oppened the instance
> ???
>
> "jodetek" <jodetek_at_free.fr> a écrit dans le message de news:
> 41e84af0$0$31518$626a14ce_at_news.free.fr...
>> Hi,
>>
>> I'm using IBM AIX 4.3.3 ML11 (3 Bits), with IBM's Java 1.3.0
>> Oracle 8.1.7.4 and the Oracle JDBC driver classes12.zip
>>
>> When I perform the following connection:
>>
>> DriverManager.registerDriver( new oracle.jdbc.driver.OracleDriver() );
>> conn = DriverManager.getConnection (
>> "jdbc:oracle:oci8:arkernel/arkernel_at_ARDEV1");
>>
>> Then, the oracle process created for my batch is not in local and
>> therefore
>> uses SQL*Net.
>>
>> ARDEV1-../jdbc/sample> ps auxww | grep oracle | grep ARDEV1
>> oracle 45908 0.0 1.0 28480 14244 - A 19:26:41 0:00 oracleARDEV1
>> (LOCAL=NO)
>>
>>
>> It's not good for performance
>>
>> Now, If I perform the following connection:
>>
>> DriverManager.registerDriver( new oracle.jdbc.driver.OracleDriver() );
>> conn = DriverManager.getConnection (
>> "jdbc:oracle:oci8:arkernel/arkernel@");
>>
>>
>> (nothing after the @, as it is shown in the Oracle documentation)
>>
>> The connection used the $ORACLE_SID environment variable and the session
>> is
>> local and that is much better for the performance.
>>
>>
>> jdelfoss 28644 0.0 1.0 28480 14284 - A 19:24:31 0:00 oracleARDEV1
>> (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)
>> ))
>>
>>
>>
>>
>> Now come the problem...
>>
>>
>> I run exactly the same program with IBM's Java 1.3.1 (instead of 1.3.0)
>> (and
>> nothing after the @ to be in local)
>>
>> I got the following error
>>
>> exception: ORA-01034: ORACLE not available
>> ORA-27123: unable to attach to shared memory segment
>> IBM AIX RISC System/6000 Error: 22: Invalid argument
>>
>> while the same connection is working with sqlplus and the database is
>> running. Is it a bug ?
>>
>> With Java 1.3.1, it's only working using SQL*Net (@ARDEV1)
>>
>> Here is the question: What is the correct way to connect to a database in
>> local (the java batch is running on the same server than the database) ?
>> We
>> don't want to use SQL*Net !
>>
>>
>>
>> Thanks for any help
>>
>> JD
>>
>>
>>
>
>
Received on Fri Jan 14 2005 - 18:05:52 CST

Original text of this message

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