posted 21 years ago
Here is the coede:-
//----------------------Code
selectstmt = "DELETE FROM AMDB.WOPAC_PID_PATRON_KEYS WHERE PATRON_KEY='"+patronkey+"'";
stmt.executeUpdate(selectstmt);
selectstmt = "INSERT INTO AMDB.WOPAC_PID_PATRON_KEYS ( PID, PATRON_KEY) VALUES ("+pid+","+patronkey+
")";
ri = stmt.executeUpdate(selectstmt);
//At this point I print out the values in the database into the log file.
stmt.close();
m_conn.close();
if (ri == 0) {
System.err.println("Table update Failed, Patron key: "
+ patronkey);
response.sendRedirect(referer + "authenticate=N&"
+ cgistr);
} else {
System.out.println("Table update Successful, Patron key: "
+ patronkey);
//The table gets updated if I comment following part. If not the page gets redirected but the table does not get updated???
I tried to redirect using javascript :- Window.open(URL,_self) it works ie. the page gets redirected and the table also gets updated. This means that sendredirect is not emptying the buffer before redirecting to the other page..
/*response.sendRedirect(referer + "authenticate=Y&"
+ "LGNT=1&BC=" + uin +"&"
);
*/
}//if
//--------------The program ends here