Skip site navigation (1) Skip section navigation (2)

Re: Where should I connect to the database?

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: "'Vicktor'" <vic(at)adv(dot)ru>, "'Dino Cherian'" <inimss(at)yahoo(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Where should I connect to the database?
Date: 2001-11-23 18:33:27
Message-ID: 004b01c1744d$5845d580$8201a8c0@inspiron (view raw or flat)
Thread:
Lists: pgsql-jdbc
Option 1 & 2 utilizing a connection pool if you want scalability, and
speed.

Dave

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Vicktor
Sent: Friday, November 23, 2001 12:51 PM
To: Dino Cherian
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] Where should I connect to the database?



Option 1 if you want your application more fast.

Vic

On Fri, 23 Nov 2001 04:11:50 -0800 (PST)
Dino Cherian <inimss(at)yahoo(dot)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
> 

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



In response to

pgsql-jdbc by date

Next:From: Nick FankhauserDate: 2001-11-23 18:54:58
Subject: Re: Where should I connect to the database?
Previous:From: Jayesh K. ParayaliDate: 2001-11-23 18:02:25
Subject: Re: Where should I connect to the database?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group