该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
public List selectdate(String time1,String time2) {
Reservation r =new Reservation();
List list=new ArrayList();
con=db.getCon();
String sql="select * from table_reservation where date=? between time1=? and time2=?";
try {
String date = null;
pstmt=con.prepareStatement(sql);
pstmt.setString(1,date);
rs=stmt.executeQuery(sql);
//数据库查询完成
while(rs.next()){
String date1=rs.getString(1);
String begintime=rs.getString(2);
String endtime=rs.getString(3);
String office=rs.getString(4);
String content=rs.getString(5);
String partment=rs.getString(6);
String name=rs.getString(7);
String phone=rs.getString(8);
String email=rs.getString(9);
String color=rs.getString(10);
r.setDate(date1);
r.setBegintime(begintime);
r.setEndtime(endtime);
r.setOffice(office);
r.setCotent(content);
r.setPartment(partment);
r.setName(name);
r.setPhone(phone);
r.setEmail(email);
r.setColor(color);
list.add(r);
//list添加预约信息成功
System.out.println(r.getColor());
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return list;
}
数据库中date是列明,现在传过来time1和time2两个参数 但是我在pstmt.setString(1,date)这不会写