It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes storing data from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "storing data from database" Watch "storing data from database" New topic

storing data from database

Amir Ghahrai
Ranch Hand

Joined: Jun 19, 2002
Posts: 110
I'm using a JSP page to call a servlet which accesses a database and retrieves some data.
on my JSP pages, I want to show 5 sets of data on each page, where users can see the next set of data by clicking a button or a link to the net page.
my question is that when I connect to database, and get all of the data, can I store the data somewhere as an object so that for the next set of data on another page, I don't have to open the database connection again?
Would sessions in this case solve the problem?
answers would be appreciated.

Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
You could store it in a session attribute.

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
I agree. Here's the link:
subject: storing data from database
It's not a secret anymore!