(一定赚了分才采纳) java.sql.SQLException:关闭的 Resultset:next

学习 时间:2026-04-07 18:58:31 阅读:1936
(一定赚了分才采纳) java.sql.SQLException:关闭的 Resultset:nextString sql="select * from t_student";\x05\x05List list = jdbcTemplate.query(sql,new RowMapper() {\x05\x05\x05public Object mapRow(ResultSet rs,int arg1) throws SQLException {\x05\x05\x05\x05List list = new ArrayList();\x05\x05\x05\x05try {\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05\x05while (rs.next()) {\x05\x05\x05\x05\x05\x05.\x05}而且异常指向的是这一行:List list = jdbcTemplate.query(sql,new RowMapper()

最佳回答

明亮的鱼

娇气的冥王星

2026-04-07 18:58:31

while (rs。next()) {\x05\x05\x05\x05\x05\x05。\x05}这个不需要这么写,直接写Students st = new Students();st。setName(rs。getString(1));list。add(st); 因为是每行结果所以你再rs。next()就报错了,已经被关闭了,你看,mapRow的意思就是每行

最新回答共有2条回答

  • 个性的汉堡
    回复
    2026-04-07 18:58:31

    while (rs。next()) {\x05\x05\x05\x05\x05\x05。\x05}这个不需要这么写,直接写Students st = new Students();st。setName(rs。getString(1));list。add(st); 因为是每行结果所以你再rs。next()就报错了,已经被关闭了,你看,mapRow的意思就是每行

上一篇 求导:xy=x-e^xy,求dy/dx

下一篇 班级 姓名 一、直接填空:(共38分,每空1分,多写、少写、错写都不得分)1.少壮不努力,.2.树树皆春色,.3.乡泪客