org.springframework.dao.InvalidDataAccessResourceUsageException: could not prepare statement; SQL [select last_insert_id()]; nested exception is org.hibernate.exception.SQLGrammarException: could not prepare statement

Stack Overflow | Virkom | 2 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Custom IdentifierGenerator

    Stack Overflow | 11 months ago | B. LORON
    org.springframework.dao.InvalidDataAccessResourceUsageException: could not prepare statement; SQL [SELECT CURRVAL('sequence_rex_id')]; nested exception is org.hibernate.exception.SQLGrammarException: could not prepare statement
  2. 0

    Java - JpaRepository SQL Error

    Stack Overflow | 4 weeks ago | QuickSort
    org.springframework.dao.InvalidDataAccessResourceUsageException: could not prepare statement; nested exception is org.hibernate.exception.SQLGrammarException: could not prepare statement
  3. 0

    DB2ZOS dialect not working after upgrading spring boot version from 1.3.5 to 1.4.2

    Stack Overflow | 4 months ago | Abdul Gaffar Khan
    org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SQL Grammar Exception in persist()

    Stack Overflow | 2 years ago | Sherzod Muminov
    org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement
  6. 0

    Datetime expression in JPA by passing as parameter

    Stack Overflow | 2 years ago | Vikram
    org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.sql.SQLSyntaxErrorException

    Syntax error: Encountered "<EOF>" at line 1, column 23.

    at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException()
  2. Derby
    EmbedConnection.prepareStatement
    1. org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
    2. org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
    3. org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
    4. org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
    5. org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
    6. org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
    7. org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
    8. org.apache.derby.impl.jdbc.EmbedPreparedStatement42.<init>(Unknown Source)
    9. org.apache.derby.jdbc.Driver42.newEmbedPreparedStatement(Unknown Source)
    10. org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
    11. org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
    11 frames
  3. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:498)
    4 frames
  4. org.apache.tomcat
    DisposableConnectionFacade.invoke
    1. org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
    2. org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
    3. org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
    3 frames
  5. com.sun.proxy
    $Proxy68.prepareStatement
    1. com.sun.proxy.$Proxy68.prepareStatement(Unknown Source)
    1 frame
  6. Hibernate
    AbstractSaveEventListener.saveWithGeneratedId
    1. org.hibernate.engine.jdbc.internal.StatementPreparerImpl$1.doPrepare(StatementPreparerImpl.java:87)
    2. org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:172)
    3. org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:78)
    4. org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:67)
    5. org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2855)
    6. org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3426)
    7. org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:81)
    8. org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:623)
    9. org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:277)
    10. org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:258)
    11. org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:303)
    12. org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:318)
    13. org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:275)
    14. org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:182)
    15. org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:113)
    15 frames
  7. org.hibernate.jpa
    JpaPersistEventListener.saveWithGeneratedId
    1. org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:67)
    1 frame
  8. Hibernate
    SessionImpl.persist
    1. org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:189)
    2. org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132)
    3. org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:58)
    4. org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:765)
    5. org.hibernate.internal.SessionImpl.persist(SessionImpl.java:750)
    5 frames
  9. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:498)
    4 frames
  10. Spring ORM
    SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke
    1. org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:298)
    1 frame
  11. com.sun.proxy
    $Proxy87.persist
    1. com.sun.proxy.$Proxy87.persist(Unknown Source)
    1 frame
  12. Spring Data JPA
    SimpleJpaRepository.save
    1. org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:508)
    1 frame
  13. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:498)
    4 frames
  14. Spring Data Core
    RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke
    1. org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.executeMethodOn(RepositoryFactorySupport.java:554)
    2. org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:539)
    2 frames
  15. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    1 frame
  16. Spring Data Core
    RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke
    1. org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:480)
    2. org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:461)
    2 frames
  17. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    1 frame
  18. org.springframework.data
    DefaultMethodInvokingMethodInterceptor.invoke
    1. org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)
    1 frame
  19. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    1 frame
  20. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    2. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
    3. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    3 frames
  21. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    1 frame
  22. Spring Tx
    PersistenceExceptionTranslationInterceptor.invoke
    1. org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
    1 frame
  23. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    1 frame
  24. Spring Data JPA
    CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke
    1. org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
    1 frame
  25. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    2. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    3 frames
  26. Spring Data Core
    SurroundingTransactionDetectorMethodInterceptor.invoke
    1. org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
    1 frame
  27. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
    2 frames
  28. com.sun.proxy
    $Proxy99.save
    1. com.sun.proxy.$Proxy99.save(Unknown Source)
    1 frame
  29. by.virkom.skss
    DvbStationsScanner.run
    1. by.virkom.skss.ctm.component.thread.DvbStationsScanner.run(DvbStationsScanner.java:51)
    1 frame