Hi I have a HQL query like this
Code:
Date now = new Date();
Date prevoius = now-interval;
SimpleDateFormat Sformat = new SimpleDateFormat("dd-MMM-yy");
String format_datenow = Sformat.format(now);
String format_dateprevious = Sformat.format(prevoius);
String markerCalcQuery = "select sum(trans_cnt) as t_cnt, location from map2_data where fdate between '"+format_dateprevious+"' and '"+format_datenow+"' and res_id = "+res_id+" group by map2_data.location";
res_row=gurculsql.rows(markerCalcQuery);
Right now if back-end is oracle I have to use the format dd-MMM-yy and if it is MySQL I use the format yyyy-MM-dd in the SimpleDateFormat. can this format be not specified when we use the date field in where clause and, be handled by Hibernate so that same format/code is used for both oracle and mysql.