-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problem with setMaxResults
PostPosted: Fri Apr 27, 2007 12:42 pm 
Newbie

Joined: Fri Apr 27, 2007 12:37 pm
Posts: 2
Location: Scottsdale, AZ
I have a Java thick client application developed using MyEclipse. The application works correctly in the MyEclipse environment but when I extract the code and run it stand alone, I get the following error:

Apr 27, 2007 9:38:02 AM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: S1009
Apr 27, 2007 9:38:02 AM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Parameter index out of range (7 > number of parameters, which is 6).
Exception in thread "Thread-3" org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2160)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2041)
at org.hibernate.loader.Loader.list(Loader.java:2036)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at nwa.pds.dao.RawPayrollRecordHome.findFor(RawPayrollRecordHome.java:90)
at nwa.pds.ui.FilterRawPayrollData$FilterRunnable.run(FilterRawPayrollData.java:40)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Parameter index out of range (7 > number of parameters, which is 6).
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:2715)
at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:2746)
at com.mysql.jdbc.PreparedStatement.setInt(PreparedStatement.java:2697)
at org.hibernate.loader.Loader.bindLimitParameters(Loader.java:1618)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1557)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2157)
... 8 more

There is a Criteria query being executed which uses setMaxResults. When I remove the setMaxResults, the query works correctly and the above error goes away. Can anyone shed light on this issue, please?

_________________
Phil Hartley


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 27, 2007 1:44 pm 
Newbie

Joined: Fri Apr 27, 2007 12:37 pm
Posts: 2
Location: Scottsdale, AZ
It turns out this problem was my fault. There were some mismatching JARs available at runtime. When I resolved this issue, the problem went away.

_________________
Phil Hartley


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.