javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query

openxava | sagartandel | 4 years 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

    Getting a GenericJDBCException

    openxava | 4 years ago | sagartandel
    javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
  2. 0

    Calling MS SQL Stored Procedure from java?

    Stack Overflow | 12 months ago | Jose D. Hernandez
    com.microsoft.sqlserver.jdbc.SQLServerException: The index 1 is out of range.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    When the Spring Data findAll(Pageable) method of an entity is called, the following query is executed by Hibernate: {code:java} select TOP(?) customer0_.id as id1_0_, customer0_.name as name2_0_ from customer customer0_ {code} After that the following query is executed: {code:java} Hibernate: select customer0_.id as id1_0_, customer0_.name as name2_0_ from customer customer0_ order by customer0_.id asc offset 0 rows fetch next 20 rows only {code} An execption is raised {code:java} o.h.engine.jdbc.spi.SqlExceptionHelper : could not execute query [select customer0_.id as id1_0_, customer0_.name as name2_0_ from customer customer0_ order by customer0_.id asc] com.microsoft.sqlserver.jdbc.SQLServerException: The index 1 is out of range. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:206) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setterGetParam(SQLServerPreparedStatement.java:940) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setValue(SQLServerPreparedStatement.java:954) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setInt(SQLServerPreparedStatement.java:1249) at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setInt(HikariProxyPreparedStatement.java) at org.hibernate.dialect.pagination.SQLServer2005LimitHandler.bindLimitParametersAtStartOfQuery(SQLServer2005LimitHandler.java:132) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1950) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1909) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1887) at org.hibernate.loader.Loader.doQuery(Loader.java:932) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349) at org.hibernate.loader.Loader.doList(Loader.java:2615) at org.hibernate.loader.Loader.doList(Loader.java:2598) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2430) at org.hibernate.loader.Loader.list(Loader.java:2425) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:502) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:370) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1481) at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1441) at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1410) at org.hibernate.query.Query.getResultList(Query.java:146) at org.hibernate.query.criteria.internal.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:72) at org.springframework.data.jpa.repository.support.SimpleJpaRepository.readPage(SimpleJpaRepository.java:589) at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll(SimpleJpaRepository.java:409) at org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll(SimpleJpaRepository.java:377) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:504) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:489) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:461) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.$Proxy170.findAll(Unknown Source) at sa.tvtc.farm.web.rest.CustomerResource.getAllCustomers(CustomerResource.java:107) at sa.tvtc.farm.web.rest.CustomerResource$$FastClassBySpringCGLIB$$48eccfb1.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at com.ryantenney.metrics.spring.TimedMethodInterceptor.invoke(TimedMethodInterceptor.java:48) at com.ryantenney.metrics.spring.TimedMethodInterceptor.invoke(TimedMethodInterceptor.java:34) at com.ryantenney.metrics.spring.AbstractMetricMethodInterceptor.invoke(AbstractMetricMethodInterceptor.java:59) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656) at sa.tvtc.farm.web.rest.CustomerResource$$EnhancerBySpringCGLIB$$9b6861c0.getAllCustomers(<generated>) {code}

    Hibernate JIRA | 2 weeks ago | Nezih DAMMAK
    com.microsoft.sqlserver.jdbc.SQLServerException: The index 1 is out of range.
  5. 0

    Java SqlServer 2k5 Coonnection Error

    Stack Overflow | 4 years ago | oneProgrammer
    com.microsoft.sqlserver.jdbc.SQLServerException: The index 3 is out of range.

    1 unregistered visitors
    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.microsoft.sqlserver.jdbc.SQLServerException

      The index 1 is out of range.

      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError()
    2. com.microsoft.sqlserver
      SQLServerPreparedStatement.setInt
      1. com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
      2. com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setterGetParam(SQLServerPreparedStatement.java:714)
      3. com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setValue(SQLServerPreparedStatement.java:723)
      4. com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setInt(SQLServerPreparedStatement.java:884)
      4 frames
    3. org.apache.tomcat
      DelegatingPreparedStatement.setInt
      1. org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setInt(DelegatingPreparedStatement.java:117)
      1 frame
    4. Hibernate
      QueryLoader.list
      1. org.hibernate.loader.Loader.bindLimitParameters(Loader.java:1810)
      2. org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1719)
      3. org.hibernate.loader.Loader.doQuery(Loader.java:801)
      4. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
      5. org.hibernate.loader.Loader.doList(Loader.java:2542)
      6. org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
      7. org.hibernate.loader.Loader.list(Loader.java:2271)
      8. org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)
      8 frames
    5. Hibernate HQL/JP-QL Parser
      QueryTranslatorImpl.list
      1. org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)
      1 frame
    6. Hibernate
      QueryImpl.list
      1. org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
      2. org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
      3. org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
      3 frames
    7. Hibernate EJB
      QueryImpl.getResultList
      1. org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:246)
      1 frame
    8. org.openxava.tab
      HiddenXTableModel.getValueAt
      1. org.openxava.tab.impl.JPATabProvider.nextBlock(JPATabProvider.java:170)
      2. org.openxava.tab.impl.JPATabProvider.nextChunk(JPATabProvider.java:139)
      3. org.openxava.tab.impl.EntityTabDataProvider.nextChunk(EntityTabDataProvider.java:32)
      4. org.openxava.tab.impl.EntityTab.nextChunk(EntityTab.java:254)
      5. org.openxava.tab.impl.TableModelBean.getRow(TableModelBean.java:121)
      6. org.openxava.tab.impl.TableModelBean.getValueAt(TableModelBean.java:172)
      7. org.openxava.tab.impl.XTableModelDecoratorBase.getValueAt(XTableModelDecoratorBase.java:63)
      8. org.openxava.tab.impl.HiddenXTableModel.getValueAt(HiddenXTableModel.java:70)
      8 frames
    9. org.openxava.web
      GenerateReportServlet$TableModelDecorator.getValueAt
      1. org.openxava.web.servlets.GenerateReportServlet$TableModelDecorator.getValueWithoutWebEditorsFormat(GenerateReportServlet.java:100)
      2. org.openxava.web.servlets.GenerateReportServlet$TableModelDecorator.getValueAt(GenerateReportServlet.java:96)
      2 frames
    10. org.openxava.util
      TableModels.toCSV
      1. org.openxava.util.TableModels.toCSV(TableModels.java:32)
      1 frame
    11. org.openxava.web
      GenerateReportServlet.doGet
      1. org.openxava.web.servlets.GenerateReportServlet.doGet(GenerateReportServlet.java:220)
      1 frame
    12. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      2 frames
    13. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      5. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      6. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      7. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      8. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      8 frames
    14. Grizzly HTTP
      JIoEndpoint$Worker.run
      1. org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
      2. org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      3. org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
      3 frames
    15. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:662)
      1 frame