hns wrote:
i have use ms access database
i have set in login.java that if user is valid then username and userid and
connection object is stored in session
now this connection object i have pulled in entire session to workout with
common object
is this good for security and performance?
I little bit worry about it


No, it's not good to store a connection object in the session. Treat the connection as a scarce resource. If you hold a connection in a session the resource is wasted and you risk running out.

Either;
a. open a connection for each request and close it at the end of the request *every time*; or
b. use a connection pool

The latter manages the connections for you, allocating you one when you need it, but managing them in a sensible way (eg. keeping the connection open but allocating them exclusively for request).

Connection Pooling for Microsoft Access:
http://support.microsoft.com/kb/169470

With JDBC:
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/conpool.html

Via Tomcat:
http://www.onjava.com/pub/a/onjava/2006/04/19/database-connection-pooling-with-tomcat.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to