RSS Forums RSS
Please support our JSP advertiser: Lunarpages JSP Web Hosting

inserting multiple selection from checkbox in to one column

Join Date: Feb 2006
Posts: 1,556
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 11
Solved Threads: 144
masijade's Avatar
masijade masijade is online now Online
Posting Virtuoso

Re: inserting multiple selection from checkbox in to one column

  #6  
Mar 30th, 2006
Are you using jdk 1.5 or an earlier version. If you are not using 1.5 then the following lines
must be changed:

  for (String val : vals) {
    pStmt.setString(1, val);
    pStmt.execute();

to:

  for (int i = 0; i < vals.length; i++) {
    pStmt.setString(1, vals[i]);
    pStmt.execute();
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  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:28 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC