title: how can i set a special date in PreparedStatement parameters?
body: <p>heloo...
  I have a problem when I want to use date in my code
  I have a class that named ReportService and in this class I use jdbc to connect my database and after that I want to get a report from my database in a special date.frist I write this :</p>
  
  <pre><code>("select sum(cost) from mem_income where trunc(date_out) = to_date ('31-jul-2013' , 'dd-mm-yyyy')");
  </code></pre>
  
  <p>and this work good.but after that I want to pass my date from my main class:</p>
  
  <pre><code>PreparedStatement pst =
  conn.prepareStatement("select sum(cost) from mem_income where trunc(date_in) = to_date (?)");
  pst.setDate(1, +++++ );
  ResultSet rs = pst.executeQuery();
  </code></pre>
  
  <p>I don't know what I should write instead of +++++</p>
  
  <p>thanks</p>