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

Home -> Community -> Usenet -> c.d.o.misc -> SOLVED: Oracle -> Java -> Oracle without creating new connection

SOLVED: Oracle -> Java -> Oracle without creating new connection

From: Manolis Fanourgakis <manolis.fanourgakis_at_ontelecoms.com>
Date: Fri, 20 Oct 2006 09:42:49 +0300
Message-ID: <eh9r59$1t40$1@ulysses.noc.ntua.gr>


Manolis Fanourgakis wrote:
> I am using an Oracle stored procedure to call a java class. I want this
> class to access the Oracle database that called it. I use the following
> line of code to get the connection:
>
> Connection cn = DriverManager.getConnection("jdbc:default:connection")
>
> Now, this works, but (I suppose) this creates a new connection. Can I
> get, somehow, the original connection that called the java class? This
> could be a lot quicker? Possibly not consuming connections from the
> connection pool?

Ok, solved it myself... The answer is really simple...

Connection cn = OracleDriver().defaultConnection();

which gets the default connection without creating a new one. Received on Fri Oct 20 2006 - 01:42:49 CDT

Original text of this message

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