In my java project I want to list the values of a table
programtable .
The table has four fields programid , program_name , start and enddate .
I want to list the details of the programs made today.
The start and end dates are in the database data type as TIMESTAMP . Help me find a request to get detailed information about the programs made today.
I am adding my code to this. I am using this method. But its not working
String todayDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
todayDatem=todayDate+" 00:00:00";
todayDaten=todayDate+" 23:59:59";
Timestamp timestamp1 = Timestamp.valueOf(todayDatem);
Timestamp timestamp2 = Timestamp.valueOf(todayDaten);
System.out.println("timestamp1:"+timestamp1+timestamp2);
String sql3 = "select * form programtable where startdate between '"+timestamp1+"' and '"+timestamp2+"'";
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
List<programmodel> pgm = jdbcTemplate.query(sql3, ParameterizedBeanPropertyRowMapper.newInstance(programmodel .class));
source
share