Unanswered: Multiple statements in resultset not working
I have a JSP web form that ties into a database. I am trying to process to statements inside a resultset loop, but cannot get it to work. I looks relatively simple, but I don't understand it. Can someone show me how or what I am doing wrong or how this could be fixed? I appreciate it. -Regards.
Statement stmt = conn.createStatement();
String id = request.getParameter("ID");
resultSet rs = stmt.executeQuery(" SELECT * FROM myTable1 WHERE id='skjones' ");
String name = rs.getString("USERNAME");
String location = rs.getString("REGION");
stmt.executeUpdate("INSERT INTO myTable2 (EMPLOYEE, SITE) VALUES (' ”+ name +“ ‘, “ ‘+ location +” ‘) ”);
Last edited by sonny105; 05-12-06 at 11:47.
Reason: incorrect wording