I have \"TABLE A\"
in database which contains 3 columns \"COL 1\" , \"COL 2\" and \"COL 3\"
with around 1000000
(1 Million) records.
You have to use Java Caching System(see here) or Ehcache (see here) to store data in cache, Inversion of Control in Spring also helps in some way but not sure whether it would help to store 1 million data in heap, as heap memory is limited.
I think you are looking for some way to cache your objects.
You may want to look at ehcache
or,
since you have large objects you can look at implementing Object Repository like, noDB
It looks like you need caching, if I get you right. I would recommend to take a look on EHcache or Infinispan here.
Hope this helps