private void updateActionPerformed(java.awt.event.ActionEvent evt) {
String id_col=studid.getText();
String last_name=lastname.getText();
String first_name=firstname.getText();
String course=cr.getText();
String school=sc.getText();
String GPA=gpa.getText();
String SCHOLARSHIP=scholar.getText();
int newID = Integer.parseInt(id_col);
double GPa=Double.parseDouble(GPA);
int scholars=Integer.parseInt(SCHOLARSHIP);
try{
rs.updateRow();
rs.updateInt("STUDENT_ID", newID);
rs.updateString("LAST_NAME", last_name);
rs.updateString("FIRST_NAME", first_name);
rs.updateString("COURSE", course);
rs.updateString("SCHOOL", school);
rs.updateDouble("GPA", GPa);
rs.updateInt("SCHOLARSHIP", scholars);
JOptionPane.showMessageDialog(STUDENSCHOLARSHIP.this,"UPDATED");
}
catch(SQLException err){
System.out.println(err.getMessage());
}
fetch();
}
我尝试if(rs.next()){}
但它不会工作。帮我吧.. :(
答案 0 :(得分:1)
rs.updateRow ()
。