plsql中执行通过的语句为:
SELECT consumption FROM dzjc.bookUse WHERE date between(to_date('2005-01-01','yyyy-mm-dd')) and (to_date('2009-03-15','yyyy-mm-dd'))
给字段连起来的语句为:
SELECT consumption FROM dzjc.bookUse WHERE datebetween(to_date('2005-01-01','yyyy-mm-dd')) and (to_date('2009-03-15','yyyy-mm-dd'))
程序中可以通过的语句为:
String SQL = "SELECT consumption FROM dzjc.bookUse WHERE date between(to_date('"+dateCreatedStart+"' ,'yyyy-mm-dd')) and (to_date('"+dateCreatedStop+"' ,'yyyy-mm-dd')) " ;
程序中报错的语句为:
String date = " between(to_date('"+dateCreatedStart+"' ,'yyyy-mm-dd')) and (to_date('"+dateCreatedStop+"' ,'yyyy-mm-dd'))";
String SQL = "SELECT consumption FROM dzjc.bookUse WHERE date ? " ;
pstmt.setString(1, date);
ResultSet rs = pstmt.executeQuery() ;
黑色头发:http://heisetoufa.iteye.com/