org.hibernate.exception.SQLGrammarException

could not insert: [com.exe.hib.bean.Student]

Solutions on the web1399

  • could not insert: [com.exe.hib.bean.Student]
  • via Coderanch by Samanthi perera, 7 months ago
    could not insert: [Student]
  • via Coderanch by Samanthi perera, 7 months ago
    could not insert: [Student]
  • Stack trace

    • org.hibernate.exception.SQLGrammarException: could not insert: [com.exe.hib.bean.Student] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2154) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2634) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519) at com.exe.hib.daoImpl.StudentDaoImpl.createStu(StudentDaoImpl.java:30) at com.exe.hib.bussinessManage.BM.main(BM.java:22) Caused by: java.sql.SQLException: 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 '.stu (stu_name, stu_sex, stu_age, stu_address, stu_description) values ('a', '?'' at line 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2926) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666) at com.mysql.jdbc.Connection.execSQL(Connection.java:2978) at com.mysql.jdbc.Connection.execSQL(Connection.java:2902) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:933) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1162) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1079) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1064) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33) ... 17 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    3 times, 3 weeks ago
    Once, 1 month ago
    Once, 1 month ago
    2 times, 2 months ago
    4 times, 2 months ago
    42 more bugmates