int j = 0;
classStus = new String[2][9];
connect.rs = connect.state.executeQuery(SQL);
while(connect.rs.next()){
System.out.println("wo zai zkks");
classStus[j][0] = connect.rs.getString("sno");
classStus[j][1] = connect.rs.getString("sname");
classStus[j][2] = connect.rs.getString("sex");
classStus[j][3] = connect.rs.getString("depart");
classStus[j][4] = connect.rs.getString("major");
classStus[j][5] = connect.rs.getString("class");
classStus[j][6] = connect.rs.getString("dong");
classStus[j][7] = connect.rs.getString("dno");
classStus[j][8] = connect.rs.getString("tell");
j++;
}
我用classStus[0][0]读取数据库为什么是显示第二行记录而不是第一行记录,而且classStus[1][0]是空值呢
------解决思路----------------------
加个断点调试下
1、看看SQL语句在数据库中查询出来是几条
2、看看ResultSet中得到的是几条数据