When I am using HQL select clause following error is occuring .student is mysql table. Error: Hibernate: select studentcla0_.vStudentName as col_0_0_ from student studentcla0_ java.lang.String
Below is Code:
public static void querySubject(Session session)
{
String sql_query="select stud.strStudentName from StudentClass as stud";
Query query1=session.createQuery(sql_query);
for(Iterator it=query1.iterate();it.hasNext();)
{
Object[] row = (Object[]) it.next();
System.out.println("Subject Name:"+row[0]);
}
return;
}