title: Passing java.sql.Date to sql query
body: <p>This is a part of my code</p>
  
  <pre><code>java.sql.Date d1=java.sql.Date.valueOf("2011-03-02"); 
  java.sql.Date d2=java.sql.Date.valueOf("2011-03-10"); 
  java.sql.Date systemDate=java.sql.Date.valueOf("2011-03-04");
  
  String sql="select id from period where '"+systemDate+"' between '"+d1+"' and '"+d2+"'";
  </code></pre>
  
  <p>This is my code. I want to get the id which falls between these dates. But i am not getting the desired result. I am getting back all the id present in the table.</p>