Re: first post !!!
Vic Cekvenich <[email protected]> Tue, 08 Apr 2003 07:39:04 -0400
| Newsgroups | gmane.comp.java.mvc.devel |
|---|---|
| Organization | baseBeans Engineering |
| Message-ID | <[email protected]> |
This is list is not for newbies and is for non-MVC. [email protected] wrote: > hello everybody, > this is my first post to the mailing list ,what i wanted to ask you all is > two > things, this is a simple application non-struts,non-mvc ... > 1) i have jsp forms submitting to servlets and servlets connect to the > database and > perform operations on the same....and then redirect the user to > success/failure pages, what ever the case may be. You should try struts. > in each servlet i am opening a connection to the database in the init( ) > method......where should i close the connection. This is not a good idea. > or please tell me if this is not the correct way to do things.... > now in a number of books that i have read, the authors have written > that database connections must be opened in the init() method of the > servlet This is a bad practice. Servelts should not have anything to do with the data base, nor should the controller. You should have a javabean for you data. The Javabean should have a DAO. The DAO talk to and connecto to db, and does the update. > > 2) what are you experiences with poolman as regards to connection pooling > > Poolman is great, but every J2EE container like tomcat has a connection pooling built in. .V > hope that you would reply back. > > thanx and regards, > amit malhotra > > >