int index=jTable12.getRowCount();
String sqlStr = null;
for(int i=0;i<=index;i++)
{
sqlStr = "delete CGRK_MX where rklsh='"+String.valueOf(jTable12.getValueAt(index,0))+"'";
try{
con = CommonaJdbc.conection;
pstmt = con.prepareStatement(sqlStr);
pstmt.execute();
}catch(java.sql.SQLException sql){
GYTJXC.view.JF_view_error error = new JF_view_error("执行的SQL语句为:\n" + sqlStr + "\n错误信息为:" + sql.getMessage());
sql.printStackTrace();
}
}
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 2 >= 2
String sqlStr = null;
for(int i=0;i<=index;i++)
{
sqlStr = "delete CGRK_MX where rklsh='"+String.valueOf(jTable12.getValueAt(index,0))+"'";
try{
con = CommonaJdbc.conection;
pstmt = con.prepareStatement(sqlStr);
pstmt.execute();
}catch(java.sql.SQLException sql){
GYTJXC.view.JF_view_error error = new JF_view_error("执行的SQL语句为:\n" + sqlStr + "\n错误信息为:" + sql.getMessage());
sql.printStackTrace();
}
}
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 2 >= 2
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货