title: Storing data in memory
body: <p>I have <code>"TABLE A"</code> in database which contains 3 columns <code>"COL 1" , "COL 2" and "COL 3"</code> with around <code>1000000</code> (1 Million) records. </p>
  
  <p>Against this table i have mapped a simple <code>POJO</code> lets say <code>"ClassA"</code> with 3 instance variables <code>"var1" , "var2" , "var3"</code> and also defined there <code>set()</code> and <code>get()</code> methods . </p>
  
  <p>My application contains simple JSPs , Servlets and POJOs with no fancy frameworks and no other technologies . </p>
  
  <p>What I actually want is that when first time my application is going to be deployed on the Application Server and the very first request which it receives , only for that request (only 1 time) my Servlet is going to get the 1 Million records from <code>TABLE A</code> , maps the ClassA with these records and starts populating the objects for <code>ClassA</code> and keep them in a Vector or an <code>ArrayList</code> , as you might have understood that my <code>Vector/ArrayList</code> will now contain 1 Million objects with each object representing a <code>record/tupple</code> in the <code>"TableA"</code> . </p>
  
  <p>OK , now come to the real and difficult part , I want this <code>Vector/ArrayList</code> to be <code>stored/persisted/added</code> to the application context or to the VM or to any other memory storage location (which actually I do not know) , so that each time my JSP <code>pages/Servlets</code> are accessing the object in memory of getting data and not hitting the database every time . </p>