开发者

Caching of DB data in java

i have got listing screens in my web app that pull quite a heavy of data from oracle database. Each time the listing screen loads it goes to DB and pull data. What I want is ,i want to have some caching teching technique that can extract data from DB and keep that in memory and that when any next request is made I should be getting data.and just like DB I should be able to filter out data from that with any sql query,jst that it won't go to DB rather pull data from memory.so that set of extracted data will be just like a view of the table and it should consistently moniter the corresponding tables so that if any update operation is made on d table it should again fetch new set of data from DB and serve.

Is there any API in java to achieve d same? in ADO.net they hv got something like recordset...i dnt know much about that. so is there any way out.my app is based on J2EE and oracle as DB.we hv got jboss as d ser开发者_如何学运维ver.Any suggestion is welcome.Thanks.


Try using Ehcache, it supports JDBC caching. And avoid creating custom solutions, if you're not JDBC guru.


You could cache the results of your query in memcached.

When your application modifies the table that you're caching, delete the cached item out of your memcached instances.

I found this quick guide to be useful: http://pragprog.com/titles/memcd/using-memcached


you can store that data into an in-memory dataset.

give this library a try:
http://casperdatasets.googlecode.com

you can iterate and scroll through the results just like a resultset, issue queries on it, sort the data, and create indexes to optimize searches - and its all memory-based.


I have 2 options for this 1) Jboss cache and you check all the details at the following link JBOSS Cache

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜