Results 1 to 2 of 2
  1. #1
    MonkeyMan is offline Member
    Join Date
    Jan 2012
    Rep Power

    Default Combobox selections in to a database


    I'm writing a simplish program which requires me to select items from a set of combo boxes and save each of the selected items to their corresponding columns in a mysql database.

    So far I've only been using the bindings systems to populate the combo boxes and while auto-generated code is handy, it's kinda obscure to reverse engineer, at least for my brain.

    I've been trying to look for similar examples of this, but truth be told, the similar cases have been too complex for me to pick the parts I need.

    Say I have 8 combo boxes with items selected, one button to write the selections to the database, and a database with 9 fields (one being the id primary) leaving the other 8 for the selections.

    If anyone would be so kind as to show me a dumbed down version of establishing a database connection through a button click, then getting the highlighted item out of each combo box and then inserting in to the correct table, it would be very much appreciated.

    (and if you happen to play eve-online, ask me for a billion isk as a reward ;) )

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: Combobox selections in to a database

    Have you done any JDBC?
    Have you got a method that will take 8 parameters and INSERT them into the relevant table in your database?

    Do you know how to write an actionListsner for a JButton?
    Have you got that code?
    Does it read the selected values from the combo boxes?

    Join para 1 to para 2...
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Erasing Memory after user selections
    By Wolfie in forum New To Java
    Replies: 3
    Last Post: 04-15-2011, 11:21 PM
  2. No values from database in Combobox
    By aborgeld in forum New To Java
    Replies: 3
    Last Post: 01-01-2011, 08:38 PM
  3. RadioButton selections in an Exam application
    By riddhikarnik in forum AWT / Swing
    Replies: 6
    Last Post: 06-29-2009, 04:41 AM
  4. List in Combobox database values
    By Glouze in forum Advanced Java
    Replies: 1
    Last Post: 01-16-2009, 05:26 PM
  5. ComboBox with database options
    By Goldy in forum Advanced Java
    Replies: 0
    Last Post: 12-01-2007, 09:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts