aspose file tools
The moose likes JDBC and the fly likes Values from ListBox to be inserted Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Values from ListBox to be inserted" Watch "Values from ListBox to be inserted" New topic
Author

Values from ListBox to be inserted

Tontang Bei
Ranch Hand

Joined: Oct 21, 2006
Posts: 130
I have a web page that forwards listbox selected values to my servlet that receives it in a String Array. How would I insert this into a dbase? Is there some datatype in mysql that can help me with this? or should I format all the values into one String and then insert it normally?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56221
    
  13

Originally posted by Tontang Bei:
I have a web page that forwards listbox selected values to my servlet


That doesn't make much sense to me. If the page is being forwarded to a servlet, it will not yet have had a chance to be displayed in the browser, and so how would the selection be made?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Tontang Bei
Ranch Hand

Joined: Oct 21, 2006
Posts: 130
Sorry, I mean after the user hits the submit button the values are extracted in a servlet
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56221
    
  13

OK, so it seems that from there you are confused as to how to save the values into a DB. So I've moved this post to a more approriate forum for such as discussion.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26201
    
  66

Tontang,
Do you have a database already set up? If so, what does the schema/ddl/table structure look like?

If not and you get to design it, consider storing each listbox value in a separate row.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Values from ListBox to be inserted
 
Similar Threads
multi-selection list box
maximum no of values listbox can hold
refresh a jtable and columns
Error on inserting data from a comboBox
populate a drop-down listbox