From: Guy Rouillier <guyr-ml1@burntmail.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: multiple connections to db over jsp
Date: Thu, 25 Oct 2007 19:08:55 -0400
Message-ID: <47212207.4070303@burntmail.com> (raw)
In-Reply-To: <47210FE5.8000909@lordlamer.de>
References: <47210FE5.8000909@lordlamer.de>
Frank Habermann wrote:
> Hello folks,
>
> First i must say that i am relativ new with java, tomcat and servlet and
> jsp.
>
> I know how to create a simple connection to postgresql with jdbc. I want
> to create some simple pages with jsp's that uses postgresql as database.
> My problem is how to implement this connection as best in jsp's.
> So i want to create 10 (for example) connections to postgresql if the
> application is loaded in tomcat so that if a user call a jsp over the
> browser the jsp don not create a connection itself. Is this possible? I
> think this is possible in a servlet. But is it possible in a jsp?
> Can somebody give me some hints or some documentation for this?!
Look up datasource in the Tomcat reference. Here's the link for 5.5:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
This creates a connection pool, and in your JSP page, you just retrieve
a connection from the pool when you need one.
--
Guy Rouillier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: guyr-ml1@burntmail.com
Subject: Re: multiple connections to db over jsp
In-Reply-To: <47212207.4070303@burntmail.com>
References: <47210FE5.8000909@lordlamer.de> <47212207.4070303@burntmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox