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);
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
Offline 4,043 posts
since Feb 2006