ResultSet rsr = Mysql.executeQuery(sqll);
try {
rsr.last();
rsr.updateString("bl",rsr.getString("id")+",");
rsr.updateRow();
System.out.print(sqll);
rsr.close();
} catch (SQLException e) {
// TODO 自动生成 catch 块
System.out.print("error");
}为什么老是输出“error”啊?应该怎么写呢/

解决方案 »

  1.   

    catch 块里输出更详细的信息看看, 这么写:System.out.println(e.getMessage());
    e.printStackTrace();
      

  2.   

    Illegal operation on empty result set
      

  3.   

    先得到一个连接对象Connection c, then Statement smt=c.createStatement(....);
    ResultSet rs=smt.executeQuery(sql);试试
      

  4.   

    错误可能出现在这个位置
    rsr.last();
    =====================
    这要求Statement smt=c.createStatement();必须带参数;
    应该这样来写Statement smt=c.createStatement(ResultSet.CONCUR_UPDATABLE 
     , ResultSet.TYPE_SCROLL_SENSITIVE);
      

  5.   

    楼上的,参数写反了,
    Statement smt=c.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE );