tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandros Kotsiras" <kotsi...@mediaondemand.com>
Subject RE: same conn pooling broker for servlets and JSPs?
Date Mon, 24 Jul 2000 19:33:45 GMT
I had the same question in the past but i realized that you should not have
Connection/PreparedStatement objects
in you JSPs. You should do all the Database processing in dbBeans and then
pass the ResultSet to the JSP page (Model2)
or Instantiate the DBBean from you JSP directly (Model1), create the
ReultSet inside the dbBean and then "get" it from your JSP.



-----Original Message-----
From: Brad Johnson [mailto:brad@papermedia.com]
Sent: Monday, July 24, 2000 2:39 PM
To: 'tomcat-user@jakarta.apache.org'
Subject: same conn pooling broker for servlets and JSPs?


I have recently downloaded a well-recommended db connection pooling class
from javaexchange.com.  The class makes use of a singleton db broker.
Javaexchange recommends that servlets access the db broker by extending a
wrapper class that holds a reference to the broker.  The wrapper class will
in turn extend HttpServlet.  Voila, servlets can now hit the database
efficiently.

My question is this:  Is it possible for JSPs in Tomcat 3.1 to access the
same db broker using the extends attribute of their respective page
directives?  I've been told the extends attribute should only be used with
extreme caution.  How tolerant is tomcat when it comes to creating a
superclass for JSPs?

Thanks in advance

brad


Mime
View raw message