This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
I want to know whether there is any mysql query to insert mulitple values taken from a jsp page... (Languages known : English, Spanish) into a single column. I mean, how do i insert both these values into the Language column in the database ?
Rebecca Green wrote:...how do i insert both these values into the Language column in the database ?
You do not insert two values in a single column. You need to end up with only one value that contains all those languages: for instance, the string "English, Spanish". Or you could try to see if normalization would help you here (keep the languages in a different table that has a many-to-many relationship with the other table).
Joined: Dec 25, 2009
I found the solution... rather simple one ;)
I just retrieved the multiple select values into a string array using getParameterValues and used another string array to store all these values (comma seperated). I then inserted this string into the database.