while (r.next()) {
String rn = r.getString(3);
String sqldate = r.getString(2); // database reservation date
}
充分利用数据库日期
DateFormat RD = new SimpleDateFormat("yyyy-MM-dd");
java.sql.Date converteddate = new java.sql.Date(RD.parse(sqldate).getTime());
Calendar cal = Calendar.getInstance();
Calendar cal1 = Calendar.getInstance();
cal.setTime(converteddate);
cal.add(Calendar.DATE, 7);
if(cal<=cal1){ }// i need to this opration i dont know how
我需要检查cal
是<= Cal1
。 有任何想法吗?