Win a copy of Java XML & JSON this week in the XML and Related Technologies forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How does a cache holds a record set  RSS feed

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, most caches including EhCache works like a Java map (ie key value pair). But it's typically used to cache database records which are returned as a row with multiple columns.
So how does it work? The key for the cache is holding the rowname, and the value is holding say an array which contains all the columns? Or for each row you have an array of these key-value pair, where the keys are the column names and the values are the cell values?
 
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either approach is possible, and I'm sure one could come up with yet more designs. What is most suitable depends on the circumstances. Does it matter how it's done, as long as it works? (Which is my snarky way of asking: "What prompted this question?" :-)
 
Mike Cheung
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay and is that how it's typically used? The reason I'm asking is because it seems to be a rather non straight forward way of storing results returned from a database. If it's like that why don't I use a vector of vector instead?
 
Police line, do not cross. Well, this tiny ad can go through:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!