Re: jdbc servlets and jsp - Mailing list pgsql-jdbc

From Luke Vanderfluit
Subject Re: jdbc servlets and jsp
Date
Msg-id 1063077373.14971.21.camel@bench.chipcity.com.au
Whole thread Raw
In response to Re: jdbc servlets and jsp  (Paul Thomas <paul@tmsl.demon.co.uk>)
Responses Re: jdbc servlets and jsp  (Paul Thomas <paul@tmsl.demon.co.uk>)
List pgsql-jdbc
Hi Paul,

thanks for your reply :-)
I'm a student trying to get java talking to a postgresql database.
My first step is to get the several components talking to each other.
So far I have got regular java classes talking to the database,
my question was about getting jsp and servlets talking to the database
using tomcat. That should be possible, though not desirable in a
production environment perhaps, as you pointed out.

Interesting to hear about your setup,

kind regards,
Luke

> I'm not sure why you would want to load the JDBC driver in your JSP. JSPs
> are part of the view layer. Your JDBC stuff should be way back in the
> persistence layer. Even servlets are really too far forward for this - use
> then more as controllers. Personally, I use JSP/Struts for the
> view/controller and obtain back-end connections using JNDI. The datasource
> name is provided as a servlet parameter in web.xml and is passed to the
> data layer on session creation. You might find it useful to look at the
> j2ee design patterns at java.sun.com.

--
====================================
"when my computer smiles, I'm happy"
===============================.~ ~,
Luke Vanderfluit               |'/']
Mobile: 0421 276 282            \~/`


pgsql-jdbc by date:

Previous
From: James Robinson
Date:
Subject: Re: JBoss w/int8 primary keys in postgres ...
Next
From: "Nick Fankhauser"
Date:
Subject: Re: jdbc servlets and jsp