• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Hard One > Default Value from a Combox Box, shown in a JList based on a prepared statement parameter

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gents,

In desperate need of help

I need to do the following

I need to select from a range of values (via a regular resultset) and show this information in a Drop Down List - I succeded

Now I need to show in a JList ONLY values that are linked to what is currently selected in the combox, that are coming out of a MySQL database and I am already over 6 hours doing it

So basically when I select an option for example 'dance' or 'circus' in the drop down list. I need to get ONLY what is linked with 'Circus' in the MySQL database (via the code I have shown)

The MySQL code is fine. Currently the Prep statement is 'prepStatement.setString (1,"Dans");' This means that no matter what I select in the main drop down list, I will only get what is linked 'Dans' and not the other genres.

I tried with this but to no avail:


Here is the code, showing the two methods. The first method works fine when called. It makes a dropdown list with just Genres.

The second however...........



I would be very grateful if someone could help

Declan D
 
Declan Dee
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just getting back. The code is actuall this:



This gives you the value of what is currently selected in the Combobox. That was the problem all along.

The rest

 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic