String sql = "select realoutupload.id,realoutupload.[orgcode],[deviceno],"
+ "[year],[yearout],[month],[monthout],[day],[dayout],[hour],[hourout] ," //此处漏掉逗号,结果仍然是正确的SQL语句,class1out变成hourout的别名
+ "[class1out],[class2out],[class3out],[min],[realout],[starttime],"
+ "[stoptime],realoutupload.[note],realoutupload.[status],realoutupload.[createtime],entitycode "
+ "from realoutupload left join org on realoutupload.orgcode=org.orgcode "
+ "[year],[yearout],[month],[monthout],[day],[dayout],[hour],[hourout] ," //此处漏掉逗号,结果仍然是正确的SQL语句,class1out变成hourout的别名
+ "[class1out],[class2out],[class3out],[min],[realout],[starttime],"
+ "[stoptime],realoutupload.[note],realoutupload.[status],realoutupload.[createtime],entitycode "
+ "from realoutupload left join org on realoutupload.orgcode=org.orgcode "
+ "WHERE realoutupload.status=1 ORDER by id";
.........
bean.setHourout(rs.getDouble(11));
bean.setClass1out(rs.getDouble(12));
bean.setClass2out(rs.getDouble(13));
bean.setClass3out(rs.getDouble(14));
bean.setMin(rs.getInt(15));
bean.setRealout(rs.getDouble(16));
bean.setStarttime(rs.getTimestamp(17)); //导致程序此处报错,不能将Double转变成时间,
bean.setStoptime(rs.getTimestamp(18));
bean.setNote(rs.getString(19));
bean.setStatus(rs.getInt(20));
这样的错误较难发现,所以记录一下。