I am working on a JSP Page which is required to insert record into two tables simultaneously.This page allows the user to add a grp and grant access rights to applications for that particular grp code. This page also has checkboxes for each application that i am listing on the page. How do i write an insert query which allows me to insert the names of those applications into the table which are checked and also the group code.There are two tables and both the tables are linked using the group code.
You can do like this:-- Let 1st Jsp ( having grp code and applications) do a submit to another Jsp say controller.jsp.
<form name="1stjsp" action="controller.jsp" method="POST"> In controller.jsp You can retrieve those parameters using request.getParameter(), request.getParameterNames() ( This is helpful when we have checkboxes and depends how you have coded the names for them). Then do JDBC connection and write/insert into tables. Finally when you are done we can forward back to the 1st page or another page using jsp forward tag. <jsp:forward page="someother.jsp" /> Hope this helps.