How to do a local connection with JDBC ?
Date: Fri, 14 Jan 2005 23:43:03 +0100
Message-ID: <41e84aeb$0$31549$626a14ce_at_news.free.fr>
Hi,
[Quoted] 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 [Quoted] 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)
[Quoted] It's not good for performance
Now, If I perform the following connection:
DriverManager.registerDriver( new oracle.jdbc.driver.OracleDriver() ); [Quoted] [Quoted] conn = DriverManager.getConnection ( "jdbc:oracle:oci8:arkernel/arkernel_at_");
[Quoted] (nothing after the _at_, as it is shown in the Oracle documentation)
The connection used the $ORACLE_SID environment variable and the session is [Quoted] 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 [Quoted] nothing after the _at_ 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 (_at_ARDEV1)
Here is the question: What is the correct way to connect to a database in [Quoted] local (the java batch is running on the same server than the database) ? We [Quoted] don't want to use SQL*Net !
Thanks for any help
JD Received on Fri Jan 14 2005 - 23:43:03 CET