Could you also mention the need for such an approach? It might be helpful to better understand the problem
Joined: Nov 05, 2007
thanks for your reply john...when many user accessing same java class..resultset value of first request user is showing to other request user...we found session handling good,but we found problem in displaying resultset value for appropriate user.so we feel resultobject based on session username may resolve these problem.what you guys feel?or may other problem?please it urgent issue..waiting for your reply guys..thanks in advances...
You cannot have different variables for different users, this is exactly why session management is used for... I don't know the exact structure/design of your code.. but i think you are not using session properly or you are sharing the instance variable in a servlet or you might have a static variable holding the result set..
1) How does that code snippet relate to the session? Do you have some list of active session variables?
2) It is good practice to close the result set quickly. This means looping through it and storing the results in a data structure. That data structure could be stored in the session. Or even a Map with the name as key if you have some reason you can't use a session.