About Connections and PreparedStatements

From: Hector Rosas <jeziel(dot)rosas(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: About Connections and PreparedStatements
Date: 2005-10-12 19:10:41
Message-ID: 25266c5c0510121210k8e16cf8id841ba11120aaf8b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello, I have a doubt with connections and PreparedStatemens. If I open a
connection to Postgres and then request a prepared statement, this will be
compiled and reused as long as I don't close the connection right? Or it
doesn't matter if I close the connection, I'm using PooledConnection
provided by my container (Orion), I want to know if there's an advantage to
keep a connections open, in order to reutilize PreparedStatement. Also, I'm
closing PreparedStatement after every query, PreparedStatement need to be
closed after every query right? I mean, is not closing a PreparedStatement a
way to increase performance?

Well, thanks everyone.

Jeziel.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-10-12 19:50:36 Re: About Connections and PreparedStatements
Previous Message Russell Francis 2005-10-10 12:59:31 Re: queries against CIDR fail against 8.0.3?