pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
multiple connections to db over jsp
3+ messages / 2 participants
[nested] [flat]

* multiple connections to db over jsp
@ 2007-10-25 21:51 Frank Habermann <lordlamer@lordlamer.de>
  2007-10-25 23:08 ` Re: multiple connections to db over jsp Guy Rouillier <guyr-ml1@burntmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Frank Habermann @ 2007-10-25 21:51 UTC (permalink / raw)
  To: pgsql-jdbc

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?!

Thanks a lot
Frank Habermann



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: multiple connections to db over jsp
  2007-10-25 21:51 multiple connections to db over jsp Frank Habermann <lordlamer@lordlamer.de>
@ 2007-10-25 23:08 ` Guy Rouillier <guyr-ml1@burntmail.com>
  2007-10-25 23:17   ` Re: multiple connections to db over jsp Frank Habermann <lordlamer@lordlamer.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Guy Rouillier @ 2007-10-25 23:08 UTC (permalink / raw)
  To: 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: multiple connections to db over jsp
  2007-10-25 21:51 multiple connections to db over jsp Frank Habermann <lordlamer@lordlamer.de>
  2007-10-25 23:08 ` Re: multiple connections to db over jsp Guy Rouillier <guyr-ml1@burntmail.com>
@ 2007-10-25 23:17   ` Frank Habermann <lordlamer@lordlamer.de>
  0 siblings, 0 replies; 3+ messages in thread

From: Frank Habermann @ 2007-10-25 23:17 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

> 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.
Thanks a lot! This is what i am searching for!

Frank



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2007-10-25 23:17 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-10-25 21:51 multiple connections to db over jsp Frank Habermann <lordlamer@lordlamer.de>
2007-10-25 23:08 ` Guy Rouillier <guyr-ml1@burntmail.com>
2007-10-25 23:17   ` Frank Habermann <lordlamer@lordlamer.de>

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