有一个蠢办法。^_^ DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); long start=format.parse("2005-02-19 00:00:00").getTime(); long end=format.parse("2005-02-20 00:00:00").getTime();"select count(id) as num from forum where posttime >=? and posttime<=?" xx.setLong(1,start); xx.setLong(2,end);
DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long start=format.parse("2005-02-19 00:00:00").getTime();
long end=format.parse("2005-02-20 00:00:00").getTime();"select count(id) as num from forum where posttime >=? and posttime<=?"
xx.setLong(1,start);
xx.setLong(2,end);