Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle -> Java -> Oracle without creating new connection
Manolis Fanourgakis wrote:
> Hi there!
>
> 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?
>
> Thanks in advance for any help.
Ok, that isn't really what you asked for but:
Wouldn't it make more sense to get the data in the PL/SQL proc and then
pass it to the java class?
I would only use Java stuff for things I can't do with PL/SQL and
querying data isn't exactly among them :-)
OC you might have some special requirements here, maybe you like to
elaborate on them ...
cheers,
Martin
Received on Thu Oct 19 2006 - 10:06:10 CDT