首页 > 代码库 > JDBC操作Oracle,根据日期查询

JDBC操作Oracle,根据日期查询

方法一:

1 SimpleDateFormat dateformat=new SimpleDateFormat("yyyy-MM-dd");
2 String today=dateformat.format(new Date());
3 
4 String delSql = "delete from ssd_pms_forecast_recode where forecasteNum = ‘"+forecastNum+"‘ and forecasteTime >=to_date(‘"+today + " 00:00:00"+"‘,‘yyyy-MM-dd HH24:mi:ss‘)" +
5                 " and forecasteTime <=to_date(‘"+today + " 23:59:59"+"‘,‘yyyy-MM-dd HH24:mi:ss‘)";