I was wondering if anyone could help me out. I get errors when i try to use the updateRow() and InsertRow() methods.
public void add( ResultSet rs ){
try{
rs.moveToInsertRow();
rs.updateString(2, "insert"
rs.updateString(3, "insert"
rs.updateInt(4, 1112221111);
rs.insertRow();
rs.beforeFirst();
}
catch( SQLException sqlex ) {
}
}
public void update(ResultSet rs){
try{
rs.updateString("First_Name", fields.First_Name.getText());
rs.updateString("Last_Name", fields.Last_Name.getText());
rs.updateString("Phone_Number", fields.Phone_Number.getText());
rs.updateRow();
JOptionPane.showMessageDialog(null, "The record has been updated", "Record Updated", JOptionPane.INFORMATION_MESSAGE);
}
catch ( SQLException sqlex ) {
sqlex.printStackTrace();
output.append( sqlex.toString() );
}
}
I'm using MS Access for the database. The way the code is right now, when i click update, we charaters show up. Nothing close to what I typed in. The insert on the other hand doesn't do anything. This class has other code to allow me to navigate through the resultSet and delete records. So, I'm sure that the connection and stuff works.
It would be great if someone can help me out here!
thanks,
MetGut