Forums Register Login

how to insert multiple check box data into database

+Pie Number of slices to send: Send
I want to insert multiple check box data into database

String[] rval = request.getParameterValues("r");
used t get the values and i have to append , between each one and insert them into single column.


After that if i want to edit data then i have to get that data and show them in related check boxes to be checked


thanks.
+Pie Number of slices to send: Send
your problem seems to be pretty straight forward. Are you looking for exact code to achieve your requirements ?

simple steps could be

1. define your table column as VARCHAR2 type.
2. grab the value of multple checkbox recieved from browser (variable - rval as shown in your post)
3. you can use String concentation operator to append comma between check box values
4. now update that string in table column

for showing that check box data back again,
1. fetch the table column value from database
2. tokenize the string using StringTokenizer using comma as seperator
3. send these individual check box value to jsp page using request or session

Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 5581 times.
Similar Threads
how to get selected check box values in struts?
Is it possible to start 20 Threads Simultaneosly under a JUnit TestCase
HTML page refresh
Gettting multiple data at a ago into the database when a call is made to em.persist
Tutorial/Review of Wicket Online
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:22:19.