File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes extracting data  from two table and populating them in a drop down box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "extracting data  from two table and populating them in a drop down box" Watch "extracting data  from two table and populating them in a drop down box" New topic
Author

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

biswajit ray
Ranch Hand

Joined: Nov 30, 2005
Posts: 30
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

Joined: Oct 03, 2005
Posts: 118
<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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: extracting data from two table and populating them in a drop down box