guravharsha -2 Light Poster

Hi,
I have one jsp page containing 2o questions retrieved from table along with its possible four-option answer in this manner:
Question1:
Option-a
Option-b
Option-c
Optio-d
All the options are in radio button form. I am trying to store the result of these question test in my final output table:

Structure of this table is:
Eventide -> int(2)->data from another event table
Question id ->int(2) ->data from questionbank table
Serialno ->int(3) ->data from questionbank table
Answer -> varchar(2) -> value of the option selected from above question page>

So, How it is possible to store the result of all question with answer equals to one of the four options in the same row of questioned.
Here questioned is same for all questions:
Here is fillquestion.jsp page:

<%-- 
    Document   : fillquestion
    Created on : Jul 18, 2008, 10:07:43 AM
    Author     : user1
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page language ="java" %>
<%@ page import="java.sql.*, javax.sql.*, javax.naming.*,java.io.*,java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Fill-up-Question</title>
    </head>
    <body>
    <form name="fill-ok" action="fill-question-ok.jsp" method="POST">
        
        <table width="50%" border="1" borderColor="#000066" cellspacing="0" cellpadding="5" align="center">
              <TBODY>
	<tr>
		<td colspan="8" align="middle" class="StripColor">
			<font class="FontGeneralBoldWhite">Fill Up the Question</font>
                        
		</td>
	</tr> 
        
        <%
        String ID=request.getParameter("id"); 
        String EVENTID=request.getParameter("EventID");
        Connection connection = null;
        Statement st = null;
        ResultSet rs = null;
        Class.forName("com.mysql.jdbc.Driver");
        Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/mynewdatabase","root", "root123");
         st=con.createStatement();
           try {
            rs = st.executeQuery("SELECT * FROM questionbank where questionid='"+ID+"'");
        
         while ( rs.next() )
	   {
           %>
	   <tr>
            <input type="hidden" name="eventid" value="EVENTID" />
		
               <td><%=rs.getString("qserialno")%>:&nbsp;&nbsp;<b>Question:</b>
              <%=rs.getString("questionname")%>
		</td>
                </tr>
                <tr>
                    <td><input type="hidden" name="QserialNO" value="<%=request.getParameter("Qserialno")%>"></td>
                <td><b>A:</b><input type="radio" name="opa" value="A" /><%=rs.getString("OptionA")%></td>           
                <td><B>B:</B><input type="radio" name="opb" value="B" /><%=rs.getString("OptionB")%></td>
                <td><B>C:</B><input type="radio" name="opc" value="C" /><%=rs.getString("OptionC")%></td> 
                <td><B>D:</B><input type="radio" name="opd" value="D" /><%=rs.getString("OptionD")%></td>                 	
                </tr>             
		        <%
                           }

                       }   finally
                       {
                           if (rs != null)
                           {
                               rs.close();
                               rs = null;
                           }
                           if (st != null)
                           {
                               st.close();
                               st = null;
                           }

                       }
                      
                   %>
    </table>
    <tr>
                <TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="SUBMIT" name="submit" /></TD>
                <td><input type="reset" value="RESET" name="reset" /></td>
                    
	       </tr>
   </form>
   </body>
   </html>

Thanks and Regards
Haresh

peter_budo commented: No hope for somebody who doesn't want to learn. DO NOT CONNECT TO DB FROM JSP! -2