title: How to declare a variable which holds Timestamp value from database?
body: <p>I have a timestamp in my database. I want to fetch it from database using JAVA and display it to the user. How do I declare timestamp in JAVA? I am using Date, but it is storing yyyy-mm-ddd format. I want yyyy-mm-dd hh:mm:ss format. </p>
  
  <pre><code>    Date date = siteBean.getAlertTime();
  </code></pre>
  
  <p>I want the date variable to hold yyyy-mm-dd hh:mm:ss
  How can I do that?</p>