String ca1 = request.getParameter("ca1_<%=i%>");
should this not be
String ca1 = request.getParameter("ca1_" + i);
Assuming the parameter names are ca1_0, ca1_1, ca1_2, etc.
At this point in the code you are already inside a scriptlet tag (at least I assume you are), so additional scriptlet tags are nothing but syntax errors.
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
If what you mean, is that you want to concatenate all values into one string and then insert that then change
for(int i = 0; rst2.next(); i++){
if(request.getParameter("ca1_"+i) !=null){
Childic = rst2.getString("Childic") ;
String query2 = "INSERT into results(ca1) values ('"+Childic+"')";
stm2.executeUpdate(query2);
} else {
// whatever it is you want here
}
}
to
for(int i = 0; rst2.next(); i++){
if(request.getParameter("ca1_"+i) !=null){
Childic = Childic + rst2.getString("Childic") ;
} else {
// whatever it is you want here
}
}
String query2 = "INSERT into results(ca1) values ('"+Childic+"')";
stm2.executeUpdate(query2);
masijade
Industrious Poster
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494