• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
murali maddy
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
 
Campbell Ritchie
Sheriff
Posts: 51469
87
  • 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.
 
Manuel Leiria
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?
 
Srikanth Basa
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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic