I am using mysql database
I want to display Employee Name from Employee table and Qualification from Details table. So in my query i created objects for both the table and tried to access it. Both table has EMPLOYEE_ID.
void showOutput() { String SQL_QUERY ="select emp.EMPLOYEE_NAME,det.QUALIFICATION from Employee emp,Details det where emp.EMOLYEE_ID=det.EMPLOYEE_ID"; Query query = session.createQuery(SQL_QUERY); Iterator itr=query.iterate(); while(itr.hasNext()){ Object row[] = (Object[]) itr.next(); System.out.println("Name : " + row[0]); System.out.println("Qualification: " + row[1]); } }
I am getting error while executing the query. Please help me to overcome this situation.
Thanks in advance.
|