如上图所示,提示数据库出错,我查了代码半天也没找到错误,麻烦大家帮忙看下是什么原因,谢谢!
代码如下:
public List queryBlank() throws Exception {
int id = 1;
List bs = new ArrayList();
try {
Connection conn=DBUtil.getConnection();
String sql=" " +
"select (body,answer,exp,kwords,difficult,other,update_time) from blank ";
PreparedStatement pstmt=conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(); //????出错行??
while (rs.next()) {
Blank b = new Blank();
b.setBody(rs.getString("body"));
b.setAnswer(rs.getString("answer"));
b.setExplain(rs.getString("exp"));
b.setKey(rs.getString("kwords"));
b.setDifficults(rs.getString("difficult"));
b.setOther(rs.getString("other"));
b.setUpdate_time(rs.getDate("update_time"));
bs.add(b);
}
return bs;
} catch (SQLException e) {
e.printStackTrace();
return null;
}
}