Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

extracting data from two table and populating them in a drop down box

 
biswajit ray
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a table called category. In which i have two fields.namely categoryname and categoryid.
CATEGORYNAME CATEGORYID
____________ ________________
AllenSolly 1
Apparrel&Accessories 2
Kitchen 3

similarly i have table called SUBCATEGORY.In which i have 3 fields namely
SUBCATEGORYNAME PARENT_ID CHILDID
_______________ ___________ __________
men 1 11
women 1 12
child 1 13
accessories 2 21
giftvoucher 2 22
shopbybrand 2 23

all i want is that to combine the table and extracting the data and to populate in a dropdown box so that under allensolly men women and child will come.and under apparrelaccessories accessories giftvoucher shopbybrand will come.If possible plz give me the code.Plz help me
.
 
Sri Ram
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<HINT>
First try to write an SQL Query which fetches the data and group by the categoryName. Use Join to combine the table. I see that, ParentID is the reference to the CategoryId in the first table.

Now, use this query in java code to populate the dropdown.
[ February 15, 2006: Message edited by: Sri Ram ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic