新手求助:关闭的 Resultset: next

sweetylela 2015-10-15 02:09:52

public Connection conntLocal() {
try {

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//Class.forName("oracle.jdbc.driver.OracleDriver");
conn_local = DriverManager.getConnection("jdbc:oracle:thin:@10.0.10.61:1521:xe","USER","A1234");

} catch (Exception e) {
conn_local = null;
e.printStackTrace();
}
return conn_local;
}
public void close_local_conn() {
try {
this.conn_local.close();
} catch (SQLException e) {
e.printStackTrace();
}
}

public ResultSet Quary(String eee) {

try {
this.psmt = this.conn_local.prepareStatement(eee);
rs = psmt.executeQuery();
} catch (Exception e) {
try {
this.psmt.close();
this.close_local_conn();
} catch (SQLException e1) {
e1.printStackTrace();
}
}
return rs;
}


//jsp页面
<%
zjHSM.conntLocal();
String sqlHSMLog="";
String SLog="";
ser = request.getParameter("ser");
sqlHSMLog = "select * from TB_HSM_LOG where T_CARD_NUMBER="+cardNum+"";
rsHSMLog = zjHSM.Quary(sqlHSMLog);

while(rsHSMLog.next())//在此处报错
{
SLog=rsHSMLog.getString("T_LOG_F");
out.println("<tr>");
out.println("<td>"+SLog+"</td>");
out.println("</tr>");
}rsHSMLog.close();
zjHSM.close_local_conn();
%>


报错关闭的 Resultset: next,求大神解答
...全文
71 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
meng_taiqian 2015-10-15
你在Query方法里面的第一个catch快里面打印下异常信息, 应该是sql的问题(如果t_card_number字段不是数字类型的话就有问题)?
回复
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2015-10-15 02:09
社区公告
暂无公告