
i have two tables in database 1table's attribute is foreign key of another in this case how to retrive value from both table and show in a gridview combine using java code

Sql query to retrieve values from two tables
SELECT * FROM emp e,dept d WHERE e.DEPT_NO = d.DEPT_NO;
where emp and dept are the database tables.
CREATE TABLE `emp` (
`EMP_NO` int(10) NOT NULL auto_increment,
`EMP_NAME` varchar(100) default NULL,
`DESIGNATION` varchar(100) default NULL,
`JOINING_DATE` date default NULL,
`SALARY` int(100) default NULL,
`DEPT_NO` int(100) default NULL,
PRIMARY KEY (`EMP_NO`)
);
CREATE TABLE `dept` (
`DEPT_NO` int(100) default NULL,
`DEPT_NAME` varchar(255) default NULL,
`BUDGETNUMBER` int(10) default NULL,
`MANAGER` varchar(255) default NULL
);