Agreed. It's never a good idea to have member variables in a servlet (or almost never a good idea - there may be exceptions I can't think of right now). A servlet is intended to be able to service multiple requests at the same time.
To be honest, that doesn't look great code even if it wasn't a servlet. It's generally a good idea to make the scope of variables no greater than necessary, and there's no apparent reason why that class couldn't use local variables.
Joined: Feb 11, 2012
I am actually trying to find out some good piece of code that shows an example of how to use a java bean, along with servlets and storing the bean attributes into a database..anybody knows good resources i can use?