tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Smith" <sat-g...@home.com>
Subject Re: How to use JDBC in JSP & servlet
Date Sat, 04 Nov 2000 20:41:48 GMT
Viet,

When you are learning the API, obviously
your first projects will use sql Connections
inside servlets and JSP. This is not very
maintainble code, though. A better plan is to
encapsulate all the JDBC code in a layer
between the JSP and the DB:

    DB --> Persistence layer --> JSP --> User.

There is no cut and dried way to do this,
however. Yes, Connection Pooling is
essential. Again, there is no one way to do it.
For stand-alone systems you can use code from
Bitmechanics. In some environments (e.g.,
Websphere) connection pooling is built in.

A cool persistence layer can be found at
http://castor.exolabs.org/


Regards,

Dave

----- Original Message -----
From: "Viet Nguyen" <viet.nguyen@vietlink.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Tuesday, January 02, 2001 1:51 PM
Subject: How to use JDBC in JSP & servlet


> I've done some programming with ASP and stand-alone JDBC apps though I'm
> completely new with JSP and servlet.  Please excuse me if these questions
> have been asked.  I'd like to how how one would use JDBC in those 2
> environments.
> 1. Should the JDBC code (open connection/execute statements..) reside in
JSP
> or in the servlet side?
> 2.  How can we effectively use JDBC connection, ie javax's connection
> pooling vs. one connection/page?
>
> thanks,
> viet.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org
>


Mime
View raw message