• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

how to display data in dropdown box from database using java code  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i have a small issue to be solved.i am using mysql database and i have 6 tables.i need to retrieve data from database and i have to display that in dropdown for example i have to display all the states names in drop down like that cities,areas...so please help me in this issue
 
Marshal
Posts: 64494
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

I am afraid that is too large a question to answer in a posting; you will need to find the Java Tutorial about databases, then download a MySQL connector.

You will have to look up tables in the Java Tutorials, too, the work out which Component to add your table to.
 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and what exactly have you done? Can you successfully retrieve the data?
 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are two different things in your question. Here is what you have to do first

1. Understand how data can be retreived using JDBC
2. Know how you populate the UI dropdown (which technology you are using is unclear)

There are plenty of examples on the net. Just search for JDBC data (Refer this http://web.njit.edu/all_topics/Servers/MySQL/Docs/mySample.java.html)
 
Good heavens! What have you done! Here, try to fix it with this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!