加try{} cathch(Exception e){}
try {
sql = "select * from nursery ";
rs=stmt.executeQuery(sql);//这里就出错了,在executeQuery(sql)有红线
for (int j = start; j <= end; j++) {
rs.absolute(j);//这里有错,不承认有absolute(j)方法
for (int a = 0; a < 9; a++)
train[a] = rs.getString(a + 2););//这里有错,不承认有rs.getString
}
catch (Exception e) {
}
try {
sql = "select * from nursery ";
rs=stmt.executeQuery(sql);//这里就出错了,在executeQuery(sql)有红线
for (int j = start; j <= end; j++) {
rs.absolute(j);//这里有错,不承认有absolute(j)方法
for (int a = 0; a < 9; a++)
train[a] = rs.getString(a + 2););//这里有错,不承认有rs.getString
}
catch (Exception e) {
}
1.try ... catch
2.throw SQLException
try{
rs=stmt.executeQuery(sql);
}catch(Exception e){
}