views:

168

answers:

1

I have a series of code books in my database, and I am using plain JDBC calls to fetch them and store them in a collection. I would like to put these in some kind of a cache at application startup time in order to save time later.

I don't need any fancy stuff like automatic object invalidation, TTL etc - the code books change rarely, so I'll trigger the update myself and just reload the whole cache when the need arises.

The project where I need this uses Spring, and this is my first project using it. Is there a standard/elegant way to do this in Spring?

Thanks.

+2  A: 

Check out Spring-cache.

Supports EHCache, OSCache and a memory cache, but allows pluggable cache providers too.

toolkit