hello friends!!!!!!!!!
I want to read parameters from text field of jsp page on servlet page
and further i want to insert these values in to database table named
result table
i am using the concept of MVC architecture.
fallowing is the code below in consern
.................................................. .................................................. ......................
//on jsp page i have written below codes
<tr>
<td><input type="text" name="text1" readonly value="<%= Math.floor(Math.random()*101)%>" size="18"/></td>
<td><input type="text" name="text2" readonly value="<%=Math.floor(Math.random()*101)%>" size="18"/></td>
<td><input type="text" name="text3" readonly value="<%=Math.floor(Math.random()*101)%>" size="18"/></td>
<td><input type="text" name="text4" readonly value="<%=Math.floor(Math.random()*101)%>" size="18"/></td>
<td><input type="text" name="text5" readonly value="<%=Math.floor(Math.random()*101)%>" size="18"/></td>
</tr>
.................................................. .................................................. ..............................
//on servlet i have written the codes below
try{
float s9=Float.parseFloat(request.getParameter("text1"). toString());
System.out.print(s9);
float s10=Float.parseFloat(request.getParameter("text2") .toString());
System.out.print(s10);
float s11=Float.parseFloat(request.getParameter("text3") .toString());
float s12=Float.parseFloat(request.getParameter("text4") .toString());
float s13=Float.parseFloat(request.getParameter("text5") .toString());
System.out.print(s13);
Time s14=Time.valueOf(request.getParameter("timetext")) ;
System.out.print(s14);
st7=conn.prepareStatement("insert into resulttable(result_time,50RS,100RS,200RS,300RS,500 RS,resno)"+
"values("+Time.valueOf(request.getParameter("timet ext"))+","+request.getParameter("text1")+"','"+req uest.getParameter("text2")+"','"+request.getParame ter("text3")+"','"+request.getParameter("text4")+" ','"+request.getParameter("text5")+"'),"+1+"");
//st7.setTime(1,s14);
// st7.setString(2, s9);
// st7.setString(3, s10);
// st7.setString(4, s11);
// st7.setString(5, s12);
// st7.setString(6, s13);
// st7.setInt(8, 1);
int i=st7.executeUpdate();
if(i==1)
{
response.sendRedirect("/jsp3/LotteryScreen.jsp");
}else
{
response.sendRedirect("/jsp3/DispResult.jsp");
}
//when i run above code it transfer controls to server side but does not show any output and neither throw any exception
I am totally confused what to do with the code?????????????????????????
please help me?????????????????????