作用:
用来保存SQL执行完的数据;
方法:
next()---------------类似指针的效果,会向下移动;
getString(int index)--------------根据索引获取指定位置的值;
getString(String columnname)-------------根据列名获取本列的值;
exm:
while(rs.next()){ String id = rs.getString(1); //String id = rs.getString("id"); String username = rs.getString(2); String password = rs.getString(3); System.out.println(id+username+password); }