0

I use a calendar to input a date in a jsp file

<sj:datepicker id="startDate" name="startDate" readonly="true" maxDate="d" changeYear="true"
                                                           buttonImageOnly="true" displayFormat="dd-M-y" yearRange="2000:2200" />

As output it give date like this 09-Nov-17

But in the database the date looks like 09-NOV-17 as I used date data type.

I wrote the sql to find the data using data as follow

if (inputBean.getStartDate() != null && !inputBean.getStartDate().trim().isEmpty()) {
        where += " and c.startDate = '" + inputBean.getStartDate().trim() + "'";
    }

But it dose not filer the data from the database by search with the input date and also show no error. How can I over come from this.

Bhanuchander Udhayakumar
  • 1,581
  • 1
  • 12
  • 30

0 Answers0