title: java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string
body: <p>I am tring to select all values from the database between two different timestamp</p>
  
  <pre><code>&lt;form action="index.jsp" METHOD="POST" &gt;
      &lt;table border="2" style="border-collapse: collapse;"&gt;
        &lt;tr&gt;
          &lt;td&gt;SELECT THE  TO DATE&lt;/td&gt;&lt;td&gt;&lt;input name="dt" type="text" id="datepicker" readonly="readonly" size="20"/&gt;&lt;/td&gt;
          &lt;td &gt;SELECT FROM DATE &lt;/td&gt;&lt;td&gt;&lt;input name="dt1" type="text" id="datepicker2" readonly="readonly" size="20"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;&lt;td colspan="4"&gt;&lt;input type="submit" value="SAVE"&gt;&lt;td&gt;&lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is second page where i am retriving the value.</p>
  
  <pre><code>       String Date1=request.getParameter("dt");
         SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy"); 
         java.util.Date date = sdf.parse(Date1);
         java.sql.Timestamp sqlStartDate = new java.sql.Timestamp(date.getTime());//2015-04-26 00:00:00.0
  
         String Date2=request.getParameter("dt1");
         java.util.Date date1=sdf.parse(Date2);
         java.sql.Timestamp sqlEndDate = new   java.sql.Timestamp(date1.getTime());//2015-06-26 00:00:00.0
  
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:xe", "RCC", "RCC@123");
  
         PreparedStatement pst=con.prepareStatement("Select * from TBLTENDERS where TSTATUSDATE between (TO_TIMESTAMP(?,'dd-mm-yyyy')) and (TO_TIMESTAMP(?,'dd-mm-yyyy'))");
         pst.setTimestamp(1, sqlStartDate); 
         pst.setTimestamp(2,sqlEndDate);
         ResultSet rest=pst.executeQuery();
  </code></pre>
  
  <p>I am getting error in the query saying "java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string". so can anyone help me with the query.</p>