Re: Where should I connect to the database? - Mailing list pgsql-jdbc

From Vicktor
Subject Re: Where should I connect to the database?
Date
Msg-id 20011123205054.687b74ca.vic@adv.ru
Whole thread Raw
In response to Where should I connect to the database?  (Dino Cherian <inimss@yahoo.com>)
Responses Re: Where should I connect to the database?
List pgsql-jdbc
Option 1 if you want your application more fast.

Vic

On Fri, 23 Nov 2001 04:11:50 -0800 (PST)
Dino Cherian <inimss@yahoo.com> wrote:

> Hi all,
>
> I would like to know which one is the best method of
> managing database connection in Java 1.3 (with
> PostgreSQL 7.1.2 JDBC).
>
> Option 1:
>     Connect to the database in the "main" function and
> disconnect on program exit. Use it throughout the life
> of the application. "Connect once and use for ever".
>
> Option 2:
>     Connect to the database near the code that uses it
> and disconnect after that block of code. "Use and
> throw away".
>
> Please help me.
>
> Thanks
> Dino
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
> http://geocities.yahoo.com/ps/info1
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

pgsql-jdbc by date:

Previous
From: "Jayesh K. Parayali"
Date:
Subject: Re: Where should I connect to the database?
Next
From: "Jayesh K. Parayali"
Date:
Subject: Re: Where should I connect to the database?