Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> SOLVED: Oracle -> Java -> Oracle without creating new connection
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
![]() |
![]() |