Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Prepared statements and pooled connections in Java app
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
![]() |
![]() |