Posts

Showing posts with the label SQLGrammarException

java.sql.SQLException: ORA-00926: missing VALUES keyword

As part of Hibernate auto increment practice, I have entered into multiple issue. Here is the one of the exception which I had entered into is  java.sql.SQLException : ORA-00926: missing VALUES keyword . Stacktrace is as follows, Apr 10, 2017 4:48:37 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions WARN: SQL Error: 926, SQLState: 42000 Apr 10, 2017 4:48:37 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions ERROR: ORA-00926: missing VALUES keyword Apr 10, 2017 4:48:37 PM org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl release INFO: HHH000010: On release of batch it still contained JDBC statements Apr 10, 2017 4:48:37 PM org.hibernate.internal.SessionImpl$5 mapManagedFlushFailure ERROR: HHH000346: Error during managed flush [could not execute statement] Exception in thread "main"  org.hibernate.exception.SQLGrammarException : could not execute statement        at org.hibernate.exception.internal.SQLStateConve

Caused by: org.hibernate.exception.SQLGrammarException: could not execute query

Caused by: org.hibernate.exception.SQLGrammarException: could not execute query exception we also got in the process of improving application performance. Because, we have upgraded MySQL-connector-java-3.1.10.jar to MySQL-connector-java-5.1.36.jar. After upgrading to the higher version, my application not at all connecting with the Data Base Schema. Because, In my application we are using JNDI data source connection. As per JNDI, MySQL connector jar will not support after MySQL-connector-java-5.1.6.jar. We are using MySQL server version as 5.1. So, I downgraded from MySQL-connector-java-5.1.36.jar to MySQL-connector-java-5.1.6.jar version. Now, Application getting loading Database Schema and started running the application. But, still I am getting the problem in some scenarios where query is not matching with proper MySQL version. Hence, I am again downgraded MySQL jar from MySQL-connector-java-5.1.6.jar to MySQL-connector-java-5.0.8.jar. Now, there are no issues in my application.