Hi,

You should use a database connection pooling of some sort.

http://onjava.com/pub/a/onjava/2006/04/19/database-connection-pooling-with-tomcat.html

Upul

On Wed, Sep 23, 2009 at 1:41 PM, John Wilkinson
<[email protected]> wrote:
> Hi,
>
> I wish to have my service persist POJO’s to a postgresql database.
>
>
>
>  Every time I call a service, do I need to connect to a database, and then
> at the end close the connection. Or is there a way to open the connection
> when the service is first called, and then close when I stop using the
> service, say by a method call?
>
>
>
>
>
> Many regards,
>
> John.
>
>
>
>
>
> ______________________________________________________________________
> This email may contain privileged or confidential information, which should
> only be used for the purpose for which it was sent by Xyratex. No further
> rights or licenses are granted to use such information. If you are not the
> intended recipient of this message, please notify the sender by return and
> delete it. You may not use, copy, disclose or rely on the information
> contained in it.
>
> Internet email is susceptible to data corruption, interception and
> unauthorised amendment for which Xyratex does not accept liability. While we
> have taken reasonable precautions to ensure that this email is free of
> viruses, Xyratex does not accept liability for the presence of any computer
> viruses in this email, nor for any losses caused as a result of viruses.
>
> Xyratex Technology Limited (03134912), Registered in England & Wales,
> Registered Office, Langstone Road, Havant, Hampshire, PO9 1SA.
>
> The Xyratex group of companies also includes, Xyratex Ltd, registered in
> Bermuda, Xyratex International Inc, registered in California, Xyratex
> (Malaysia) Sdn Bhd registered in Malaysia, Xyratex Technology (Wuxi) Co Ltd
> registered in The People's Republic of China and Xyratex Japan Limited
> registered in Japan.
> ______________________________________________________________________
>



-- 
http://upulgodage.com

Reply via email to