org.hibernate.exception.SQLGrammarException: could not insert: [com.Course]
Caused by: java.sql.SQLException: [SQLCODE: <-30>:<Table or View not found>]
[Cache Error: <<SYNTAX>errdone+2^%qaqqt>]
[%msg: < SQL ERROR #30: Table 'SQLUSER.COURSE' not found>]
Thanks, I'll try that. But when I created the table course explicitly using a query in the database, it inserted fine.Seems like I need to write explicit code for creating the table and then call session.save method?
Joined: Dec 23, 2008
That may be because you have used auto-increment setting in your DB.
but when you use generator class = "assigned", hibernate expects you to set id on your bean class while saving.
try setting generator class to native and post result.
Since your genegrator is assigned hence you need to set it's value explictly which is missing in your code base below.
So, set value like obj.setCourseId(1111); make sure COURSEID is declared in smaller in your pojo class. I am sure it will resolve the issue.