File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and Relational Databases and the fly likes Values from ListBox to be inserted Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 62118
    
  68

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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: 62118
    
  68

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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31571
    
185

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.


[OCA 8 book] [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
 
rocket mass heater kickstarter
 
subject: Values from ListBox to be inserted