org.hibernate.exception.SQLGrammarException
org.hibernate.exception.SQLGrammarException - could not execute statement
my sample code is,
Session session=Hibernateutil.getSessionFactory().openSession();
session.beginTransaction();
Query qry=session.createQuery("from Main");
List<Main> id=(List<Main>) qry.list();
System.out.println("--->"+id);
session.getTransaction().commit();
session.close();
return "success";
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near '.main (name,
pass, phone, address, empid) values ('sadg', 'asdgas', 10, 'Chennai' at
line 1
No comments:
Post a Comment