Re: SQL CallableStatement execute and close
From: Charles Fineman (cfineman-no&spam_at_yahoo.com)
Date: 03/17/04
- Previous message: cfineman_at_yahoo.com: "Recomendations for a low priced jdbcOdbc bridge for talking to Access or FoxPro dbs?"
- In reply to: guy: "SQL CallableStatement execute and close"
- Next in thread: guy: "Re: SQL CallableStatement execute and close"
- Reply: guy: "Re: SQL CallableStatement execute and close"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 17 Mar 2004 14:12:45 -0500
No. Once you've closed it, the driver will release the resources
associated with the statement (this is putting aside the caching
that many of the JDBC drivers are using these days).
As far as performance goes, yes it will almost certainly effect
your performance (again ignoring caching). As far as Oracle goes,
I seem to recall that they keep around compiled code in the SGA
unless it gets bumped out so you might not have to pay the
compilation costs again.
If you decide you want to use statement caching then you should keep
two things in mind:
1) The "out of the box" caching that the drivers tend to implement is
LRU. If you have a relatively expensive (to compile) prepared statement
it might get bumped out by smaller ones.
2) If you decide to do your own caching (we did this to implement a
use-count based caching policy) you need to keep in mind that you can
only use a prepared statement with the connection it was originally
created on (at least that was true for Oracle). This means you need to
have a cache for each connection. I wrote a Driver and Connection
"decorator" class to do this.
guy wrote:
> If I'm using the close() method after executing a callableStatement.
> I need to activate the procedure in a predefined interval.
> two questions:
> 1. can I execute the statement again without building it all over again?
> 2. Does it make any difference (performance wise)?
- Previous message: cfineman_at_yahoo.com: "Recomendations for a low priced jdbcOdbc bridge for talking to Access or FoxPro dbs?"
- In reply to: guy: "SQL CallableStatement execute and close"
- Next in thread: guy: "Re: SQL CallableStatement execute and close"
- Reply: guy: "Re: SQL CallableStatement execute and close"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|