This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes caching data 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 » Databases » JDBC
Bookmark "caching data" Watch "caching data" New topic
Author

caching data

dhriti joshi
Ranch Hand

Joined: Aug 13, 2002
Posts: 82
I am fetching the resultset form oracle DB in my java class.

But since I do not want to query each time for performance reasons,I would like to keep the data in cache and call query after every 30 min.

How can I do this?any hints..

Thanks in advance,
Dhriti.
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
Well I assume you are going to stuck the data into an object or a bunch of objects whether it been through an ORM or just straight JDBC calls. Stick the object[s] in a persistent state (Application for a web app where the query is the same for all users, Session per user cache, a swing app is naturally persistent if the object remains in scope) with a timestamp and check the timestamp everytime. What more is there to know?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: caching data
 
Similar Threads
Outputting sql output to spreadsheet
Performance Consideration - EJB/DAO/etc.
Ajax : when a large no. of form fields
Refresh a relationship
Regarding duplicate insert problem