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

Hibernate JIRA | Irena | 9 years ago
  1. 0

    Trying to do simple thing: List<Subject> subjects = (List<Subject>) currSession.createQuery("from Subject").setMaxResults(10).list(); this prings fallowing: WARN JDBCExceptionReporter:71 - SQL Error: -104, SQLState: 42601 ERROR JDBCExceptionReporter:72 - DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: 10;select top ;. WARN JDBCExceptionReporter:71 - SQL Error: -727, SQLState: 56098 ERROR JDBCExceptionReporter:72 - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-104;42601;10|select top |. WARN JDBCExceptionReporter:71 - SQL Error: -727, SQLState: 56098 ERROR JDBCExceptionReporter:72 - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-104;42601;10|select top |. Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2147) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028) at org.hibernate.loader.Loader.list(Loader.java:2023) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393) 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 ru.nbch.quality.logic.ReportProcessor.main(ReportProcessor.java:66) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: 10;select top ;. at com.ibm.db2.jcc.b.id.e(id.java:1640) at com.ibm.db2.jcc.b.id.a(id.java:1229) at com.ibm.db2.jcc.c.fb.h(fb.java:149) at com.ibm.db2.jcc.c.fb.a(fb.java:43) at com.ibm.db2.jcc.c.s.a(s.java:30) at com.ibm.db2.jcc.c.wb.g(wb.java:152) at com.ibm.db2.jcc.b.id.n(id.java:1209) at com.ibm.db2.jcc.b.jd.eb(jd.java:1779) at com.ibm.db2.jcc.b.jd.a(jd.java:2232) at com.ibm.db2.jcc.b.jd.V(jd.java:505) at com.ibm.db2.jcc.b.jd.executeQuery(jd.java:488) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186) at org.hibernate.loader.Loader.getResultSet(Loader.java:1668) at org.hibernate.loader.Loader.doQuery(Loader.java:662) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2144) ... 13 more

    Hibernate JIRA | 9 years ago | Irena
    org.hibernate.exception.SQLGrammarException: could not execute query
  2. 0

    Trying to do simple thing: List<Subject> subjects = (List<Subject>) currSession.createQuery("from Subject").setMaxResults(10).list(); this prings fallowing: WARN JDBCExceptionReporter:71 - SQL Error: -104, SQLState: 42601 ERROR JDBCExceptionReporter:72 - DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: 10;select top ;. WARN JDBCExceptionReporter:71 - SQL Error: -727, SQLState: 56098 ERROR JDBCExceptionReporter:72 - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-104;42601;10|select top |. WARN JDBCExceptionReporter:71 - SQL Error: -727, SQLState: 56098 ERROR JDBCExceptionReporter:72 - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-104;42601;10|select top |. Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2147) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028) at org.hibernate.loader.Loader.list(Loader.java:2023) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393) 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 ru.nbch.quality.logic.ReportProcessor.main(ReportProcessor.java:66) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: 10;select top ;. at com.ibm.db2.jcc.b.id.e(id.java:1640) at com.ibm.db2.jcc.b.id.a(id.java:1229) at com.ibm.db2.jcc.c.fb.h(fb.java:149) at com.ibm.db2.jcc.c.fb.a(fb.java:43) at com.ibm.db2.jcc.c.s.a(s.java:30) at com.ibm.db2.jcc.c.wb.g(wb.java:152) at com.ibm.db2.jcc.b.id.n(id.java:1209) at com.ibm.db2.jcc.b.jd.eb(jd.java:1779) at com.ibm.db2.jcc.b.jd.a(jd.java:2232) at com.ibm.db2.jcc.b.jd.V(jd.java:505) at com.ibm.db2.jcc.b.jd.executeQuery(jd.java:488) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186) at org.hibernate.loader.Loader.getResultSet(Loader.java:1668) at org.hibernate.loader.Loader.doQuery(Loader.java:662) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2144) ... 13 more

    Hibernate JIRA | 9 years ago | Irena
    org.hibernate.exception.SQLGrammarException: could not execute query
  3. 0

    I am getting sql error while retrive the data from server

    Coderanch | 3 years ago | sachin pate
    com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -516, SQLSTATE: 26501, SQLERRMC: null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I am getting error likeSQLCODE: -104, SQLSTATE: 42601, SQLERRMC: ;;INFORMATION' );END-OF-STATEMENT

    Coderanch | 3 years ago | sachin pate
    com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: ;;INFORMATION' );END-OF-STATEMENT
  6. 0

    Hibernate Community • View topic - org.hibernate.exception.LockAcquisitionException: could not

    hibernate.org | 8 months ago
    org.hibernate.exception.LockAcquisitionException: could not delete collection: [com.sample.Item.subItems #125777]

    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. com.ibm.db2.jcc.b.SqlException

      DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: 10;select top ;.

      at com.ibm.db2.jcc.b.id.e()
    2. com.ibm.db2
      jd.executeQuery
      1. com.ibm.db2.jcc.b.id.e(id.java:1640)
      2. com.ibm.db2.jcc.b.id.a(id.java:1229)
      3. com.ibm.db2.jcc.c.fb.h(fb.java:149)
      4. com.ibm.db2.jcc.c.fb.a(fb.java:43)
      5. com.ibm.db2.jcc.c.s.a(s.java:30)
      6. com.ibm.db2.jcc.c.wb.g(wb.java:152)
      7. com.ibm.db2.jcc.b.id.n(id.java:1209)
      8. com.ibm.db2.jcc.b.jd.eb(jd.java:1779)
      9. com.ibm.db2.jcc.b.jd.a(jd.java:2232)
      10. com.ibm.db2.jcc.b.jd.V(jd.java:505)
      11. com.ibm.db2.jcc.b.jd.executeQuery(jd.java:488)
      11 frames
    3. c3p0:JDBC DataSources/Resource Pools
      NewProxyPreparedStatement.executeQuery
      1. com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
      1 frame
    4. Hibernate
      QueryLoader.list
      1. org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
      2. org.hibernate.loader.Loader.getResultSet(Loader.java:1668)
      3. org.hibernate.loader.Loader.doQuery(Loader.java:662)
      4. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
      5. org.hibernate.loader.Loader.doList(Loader.java:2144)
      6. org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
      7. org.hibernate.loader.Loader.list(Loader.java:2023)
      8. org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
      8 frames
    5. Hibernate HQL/JP-QL Parser
      QueryTranslatorImpl.list
      1. org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
      1 frame
    6. 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
    7. ru.nbch.quality
      ReportProcessor.main
      1. ru.nbch.quality.logic.ReportProcessor.main(ReportProcessor.java:66)
      1 frame
    8. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    9. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
      1 frame