Hello, I'm having a problem doing a SQL insert from my JSP. The below code gets executed once, however it's doing 2 INSERTs. When I comment out "stmt.executeUpdate(sSQL);" then it only INSERTs once. So I assume the "stmt = conn.createStatement" is executing the SQL as well, but how would it know what SQL to execute?
Can anyone see what I'm doing wrong? Thank you! ~ Troy Campano ~ //begin code for(int counter = 0; counter < AddDbaArray.length; counter++) { sSQL = "INSERT INTO inv.jn_db_user_t (db_id, user_id, user_typ_cde, row_crt_dte, row_upd_dte, row_dlet_ind) "; sSQL = sSQL + "VALUES ('" + AddDbaArray[counter] + "','" + user_id + "','0',sysdate,sysdate,'N')"; displayHTML = displayHTML + sSQL; stmt = conn.createStatement(); stmt.executeUpdate(sSQL); stmt.close(); stmt = null; out.println("The row was inserted"); } //end code =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com