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

Home -> Community -> Usenet -> c.d.o.server -> Prepared statements and pooled connections in Java app

Prepared statements and pooled connections in Java app

From: Frank LaRosa <frank_at_franklarosa.com>
Date: 2 Apr 2002 10:16:45 -0800
Message-ID: <2f282f37.0204021016.2477471c@posting.google.com>


Hi,

I'm writing a Java application and trying to determine how connections obtained by the OracleConnectionPoolDataSource will behave with respect to prepapred statements.

In particular, let us say I execute the following sequence in my application:
(1) Obtain connection from OracleConnectionPoolDataSource
(2) Execute prepareStatement() to obtain a prepared statement
(3) Fill in parameters and execute the prepared statement
(4) Close the prepared statement
(5) Close the connection

Assume I do this once, then do it again later, and I happen to obtain the same connection from the pool. Will step 2 cause the server to re-parse and prepare the SQL statement, or will it reuse the results of the earlier preparation? Obviously, the latter is what I would like, for performance reasons.

I will ultimately be running this in a Weblogic environment, but not currently taking advantage of J2EE connection pooling facilities (I can convert to using them if it would help). Thanks.

Frank Received on Tue Apr 02 2002 - 12:16:45 CST

Original text of this message

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