• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
.
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic