Hi dave ,
Here is the code :-
//----------------------------------------------------------------
con = DriverManager.getConnection(
"jdbc

racle:thin:@"
+ myProp.getProperty("oracle_server","server:1221:IIBR")
, myProp.getProperty("oracle_user","usr")
, myProp.getProperty("oracle_pw","pass"));
stmt = con.createStatement();
// delete prior attempts
ri2=stmt.executeUpdate("DELETE FROM AMDB.WOPAC_PID_PATRON_KEYS "
+ "WHERE PATRON_KEY = '" + patronKey + "' ");
con.setAutoCommit(false);
ri = stmt.executeUpdate("INSERT INTO AMDB.WOPAC_PID_PATRON_KEYS "
"( PID, PATRON_KEY) " + "VALUES " + "(" + sPID + ", '" + patronKey + "')");
con.commit();
// for validation
if (ri == 0) {
//Throw error
} // if (ri == 0)
else {
//Redirect
} // else
stmt.close();
con.close();
//------------------------------------------------------
Note :- It deletes the records. ie the records get removed from the table.
But in case of insert it inserts the record(ie. returns ri=1), but the table does not get updated.
Iam catching both SQLException and exception.
hope that helps.
thanks,
suresh