title: How can we cache the MySQL query on the server side running java web application?
body: <p>Example:
  If most clients require to fill the form which require selection of states and cities. So how could this query can be cached on the server side. Because the state or the city name hardly changes, so its good idea to cache them.</p>
  
  <pre><code>Table 1:
  state_name  state_id
  __________  ________
  state1         1
  state2         2
  
  Table 2:
  city_name   city_id   state_id
  _________   _______   ________
  city1          1         1
  city2          2         1
  city3          3         2
  </code></pre>