I think its the problem of not loading your hibernate.cfg.xml file in your application. I too got the same problem. I have tried with the following code in my project: Configuration cfg = new Configuration (); cfg.configure ("hibernate.cfg.xml"); Then it has worked fine. Hope this will help. java.sql.SQLSyntaxErrorException: Access denied for user 'service-account'@'%' to database 'our_database' The problem is that that specific exception is not being caught by the catch (Exception e) block in the above code. Post subject: GenericJDBCException: Could not open connection. Posted: Fri Feb 15, 2013 6:51 am. Newbie. Joined: Wed Aug 29, 2012 2:00 pm. Posts: 2. I'm using Spring 3.2.0 with the same version of Spring security and Oracle 10g. Recently, I have upgraded Hibernate from 3.2.5 to 4.2.0.CR1. With this update, the following warnings appear on the I have a User object class which is was mapped using hbm.xml and the database is connecting fine, however returns the following error: ERROR: Syntax error: Encountered "USER" at line 1, column 13. Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not prepare statement. Vay Tiแปn Nhanh Ggads.

jdbc exception on hibernate data access