两种解决方法,第一种:try{
while(rs.next())
{
System.out.println("id"+rs.getString(1));
System.out.println("name"+rs.getString(2));
}
}catch(Exception e)
{
}
用try,catch包含
第二种:throws SQLException一下
转载于:https://www.cnblogs.com/java-sap/archive/2011/12/09/2282912.html