【发布时间】:2014-01-02 18:18:02
【问题描述】:
我有这个问题:
String sql ="select col1,col2,col3 from table where tstamp between '01/01/2014 00:00' and '01/01/2014 23:59'" ;
我想像这样使用PreparedStatement 到setDate:
String sql = "select col1,col2,col3 from table where tstamp between ? and ? " ;
PreparedStatement p = connection.prepareStatement(sql);
p.setDate(1,..);
我不知道该怎么做..请帮忙
我尝试了新的Date(int,int,int) 构造函数,但它没有设置小时和分钟。
【问题讨论】: