Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes Sessions with database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Sessions with database" Watch "Sessions with database" New topic
Author

Sessions with database

anand chawla
Ranch Hand

Joined: Oct 19, 2000
Posts: 91
HI Guys
just caught with one problem
can anyone tell me how do i solve this problem of mine.
I am devloping a program for online exams.The two problems i m facing is that if one person is answering the first question the other one on the network is getting the second one...naturally because of thread concept...but can anyone tell me how do i solve this problem....someone had told me to use implement SingleThreadModel which i did and to some extent it worked...but my requirement is to create a session...and i have very little doubt as to how to go about it....even if i create session what are the values i attach to it.....
pls help
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

you use the getSession() method of HTTPRequest object to create the session, the use putValue() method of HTTPSession object.

although you might want to create a class to hold the values and add an object of that class to the session instead.


SCJP
Visit my download page
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Sessions with database
 
Similar Threads
Sessions with database
Inserting Date in database
Displaying the close,min and max button on the left of JFrame
Tomcat with Windows 98 installation issue
Unable to get a PooledConnection from the DataSource