Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> How to do a local connection with JDBC ?
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 - 16:43:08 CST