title: get day month year from java.sql.date
body: <p>My question is simple my <code>SQL</code> query from java returns a date and assign it to a <code>java.sql.Date</code> variable.</p>
  
  <p>however i want to get each of the day, month and year as int.  It seems that the methods <code>getDay()</code>,<code>getMonth()</code> are deprecated.</p>
  
  <p>Are there any other way to achieve this?</p>
  
  <p>what i tried for testing is:</p>
  
  <pre><code>String date = "2015-04-12";
  java.sql.Date dat = java.sql.Date.valueOf(date);
  </code></pre>
  
  <p>now i want year, month and day in an int variable each.</p>