bkmr_77 wrote:
I dont have enough information from your post but your code should be as follows
Code:
String SQL_STRING = "FROM Error";
Query query = session.createQuery( SQL_STRING );
System.out.println( query );
List list = query.list();
for(int i=0; i<list.size();i++){
System.out.println(list.get(i));
}
I agree, there's not enough info to help him.
I would just change the first line of the above code to
Code:
final String HQL_STRING = "FROM Error";
because this is HQL and not SQL, so it could lead beginners to mistakes...
In fact, in you want to execute SQL directly, it's session.createSQLQuery(), but I'd recommend to try to use SQL as little as possible. In fact, it's better to use HQL or Criteria API because the queries are Object Oriented, instead of DB oriented.