From: | Guy Rouillier <guyr-ml1(at)burntmail(dot)com> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: multiple connections to db over jsp |
Date: | 2007-10-25 23:08:55 |
Message-ID: | 47212207.4070303@burntmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Frank Habermann | 2007-10-25 23:17:29 | Re: multiple connections to db over jsp |
Previous Message | Kris Jurka | 2007-10-25 22:47:48 | Re: Calling a stored procedure with a custom return type |