org.hibernate.exception.DataException: could not execute query

Hibernate JIRA | Don Smith | 1 decade 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

    The following HQL List results = executeQuery("select timestampdiff(FRAC_SECOND, startDate, endDate) from IntervalTracker order by id"); throws this stack trace: org.hibernate.exception.DataException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2211) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2092) at org.hibernate.loader.Loader.list(Loader.java:2087) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at com.novell.soa.persist.HibernateDateDiffTest.executeQuery(HibernateDateDiffTest.java:152) at com.novell.soa.persist.HibernateDateDiffTest.testDateDiff(HibernateDateDiffTest.java:121) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) Caused by: com.mysql.jdbc.exceptions.MySQLDataException: '3605940000000' in column '1' is outside valid range for the datatype INTEGER. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:893) at com.mysql.jdbc.ResultSet.throwRangeException(ResultSet.java:7391) at com.mysql.jdbc.ResultSet.getNativeInt(ResultSet.java:3967) at com.mysql.jdbc.ResultSet.getNativeInt(ResultSet.java:3892) at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2555) at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2570) at org.hibernate.type.IntegerType.get(IntegerType.java:28) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:161) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:150) at org.hibernate.loader.hql.QueryLoader.getResultColumnOrRow(QueryLoader.java:333) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:594) at org.hibernate.loader.Loader.doQuery(Loader.java:689) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2208) ... 38 more

    Hibernate JIRA | 1 decade ago | Don Smith
    org.hibernate.exception.DataException: could not execute query
  2. 0

    The following HQL List results = executeQuery("select timestampdiff(FRAC_SECOND, startDate, endDate) from IntervalTracker order by id"); throws this stack trace: org.hibernate.exception.DataException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2211) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2092) at org.hibernate.loader.Loader.list(Loader.java:2087) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at com.novell.soa.persist.HibernateDateDiffTest.executeQuery(HibernateDateDiffTest.java:152) at com.novell.soa.persist.HibernateDateDiffTest.testDateDiff(HibernateDateDiffTest.java:121) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) Caused by: com.mysql.jdbc.exceptions.MySQLDataException: '3605940000000' in column '1' is outside valid range for the datatype INTEGER. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:893) at com.mysql.jdbc.ResultSet.throwRangeException(ResultSet.java:7391) at com.mysql.jdbc.ResultSet.getNativeInt(ResultSet.java:3967) at com.mysql.jdbc.ResultSet.getNativeInt(ResultSet.java:3892) at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2555) at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2570) at org.hibernate.type.IntegerType.get(IntegerType.java:28) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:161) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:150) at org.hibernate.loader.hql.QueryLoader.getResultColumnOrRow(QueryLoader.java:333) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:594) at org.hibernate.loader.Loader.doQuery(Loader.java:689) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2208) ... 38 more

    Hibernate JIRA | 1 decade ago | Don Smith
    org.hibernate.exception.DataException: could not execute query

    Root Cause Analysis

    1. com.mysql.jdbc.exceptions.MySQLDataException

      '3605940000000' in column '1' is outside valid range for the datatype INTEGER.

      at com.mysql.jdbc.SQLError.createSQLException()
    2. MySQL jdbc
      ResultSet.getInt
      1. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:893)
      2. com.mysql.jdbc.ResultSet.throwRangeException(ResultSet.java:7391)
      3. com.mysql.jdbc.ResultSet.getNativeInt(ResultSet.java:3967)
      4. com.mysql.jdbc.ResultSet.getNativeInt(ResultSet.java:3892)
      5. com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2555)
      6. com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2570)
      6 frames
    3. Hibernate
      QueryLoader.list
      1. org.hibernate.type.IntegerType.get(IntegerType.java:28)
      2. org.hibernate.type.NullableType.nullSafeGet(NullableType.java:161)
      3. org.hibernate.type.NullableType.nullSafeGet(NullableType.java:150)
      4. org.hibernate.loader.hql.QueryLoader.getResultColumnOrRow(QueryLoader.java:333)
      5. org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:594)
      6. org.hibernate.loader.Loader.doQuery(Loader.java:689)
      7. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
      8. org.hibernate.loader.Loader.doList(Loader.java:2208)
      9. org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
      10. org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      11. org.hibernate.loader.Loader.doList(Loader.java:2211)
      12. org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2092)
      13. org.hibernate.loader.Loader.list(Loader.java:2087)
      14. org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
      14 frames
    4. Hibernate HQL/JP-QL Parser
      QueryTranslatorImpl.list
      1. org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
      1 frame
    5. Hibernate
      QueryImpl.list
      1. org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
      2. org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
      3. org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
      3 frames
    6. com.novell.soa
      HibernateDateDiffTest.testDateDiff
      1. com.novell.soa.persist.HibernateDateDiffTest.executeQuery(HibernateDateDiffTest.java:152)
      2. com.novell.soa.persist.HibernateDateDiffTest.testDateDiff(HibernateDateDiffTest.java:121)
      2 frames
    7. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    8. JUnit
      TestSetup.run
      1. junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
      2. junit.extensions.TestSetup$1.protect(TestSetup.java:19)
      3. junit.extensions.TestSetup.run(TestSetup.java:23)
      3 frames
    9. IDEA
      JUnitStarter.main
      1. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
      1 frame
    10. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    11. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
      1 frame