View Single Post
Join Date: Feb 2006
Posts: 2,460
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 263
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: inserting multiple selection from checkbox in to one column

 
0
  #4
Mar 30th, 2006
No What I meant was using the JDBC prepared statement. here an example:

  1. String[] vals = request.getParameterValues("checkbox");
  2. try {
  3. PreparedStatement pStmt = conn.prepareStatement("Insert into table (field) values (?)");
  4. for (String val : vals) {
  5. pStmt.setString(1, val);
  6. pStmt.execute();
  7. }
  8. } catch .....

of course replacing checkbox, table, and field with the real things.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote