有两个可能

1、rs ,state和conn没有关闭

rs.close();  state.close();  conn.close();

if(rs!=null) rs.close;  if(state!=null) state.close;  if(conn!=null) conn.close;

---

流程

import java.sql.Connection;

  Connection conn = null;
try {
   conn = getConnection();

     conn.close();
  } catch (SQLException e) {
   e.printStackTrace();
  } finally {
   closeConnection(conn); // 关闭连接
  }

2、执行的数据库查询没有查询到任何结果,却调用了rs.next() 或者,游标到了查询出来的最后一条记录,又调用了rs.next()则,会找不到next条记录 
       

         String swglm_hou = rs_select2.getString(1);

         我是这一行报错,而且是执行到循环的最后一次循环才报的错

相关文章:

  • 2021-08-08
  • 2021-10-29
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2021-08-10
  • 2021-07-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-03-26
  • 2022-12-23
  • 2021-04-22
  • 2021-09-08
  • 2021-08-02
相关资源
相似解决方案