title: Compare date and time range from database with user input date and time
body: <p>I am trying to handle vehicle reservation(using JSP servlets). My database contain startdate, starttime, returndate, returntime. Now I insert new date range and new time range for a new vehicle reservation. I need query or algorithm weather new input is acceptable. (The date range and time range should not clash with the data which are already available)
  My Data base fields and some of its values:</p>
  
  <pre><code>Startdate       starttime       returndate      returntime
  2013-12-10      10:00:00        2013-12-12      15:00:00
  2013-12-16      09:00:00        2013-12-16      12:00:00
  2013-12-16      12:15:00        2013-12-16      16:00:00    
  </code></pre>