I want to delete data from a mysql table if its with current date.
This is the code I wrote and is showing an exception at line "ERROR":
What is the procedure to delete data from tables with a where condition applied?
Date date=new Date();
SimpleDateFormat myFormat=new SimpleDateFormat("dd-MM-yyyy");
String todayDate=myFormat.format(date);
String query="delete * from today_list where today_date="+"'"+todayDate+"'";
Transaction t1=session.beginTransaction();
session.createQuery(query).executeUpate();//ERROR
t1.commit();