Hi,
I really need help to resolve this problem because I already did a lot of search but got no answer on this. My project is a J2EE application which use JBoss, Hibernate and SQL Server 2000. I'm a hibernate beginner. My project works fine when accessing MySQL server. But after I switch to the SQL Server. I got following exception:
13:12:07,320 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
13:12:07,320 ERROR [JDBCExceptionReporter] The requested operation is not supported on forward only result sets.
13:12:07,320 INFO [STDOUT] org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1564)
at org.hibernate.loader.Loader.list(Loader.java:1544)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:830)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.wellsfargo.fedata.dao.AssumptionDao.getOwnedAssumptionList(AssumptionDao.java:284)
My code is very simple:
Code:
lSession = openSession();
lTx = lSession.beginTransaction();
Query lQuery = lSession.createQuery("from AssumptionListItem as m where m.userId = :userId order by m.id" );
lQuery.setString("userId", aUserId);
lQuery.setMaxResults(aPageSize);
lQuery.setFirstResult(aPageSize * aPageNumber);
lItems = lQuery.list();
Since my project works fine with MySQL, I'm guessing this must be related to some special configuration in Hibernate in order to access SQL Server configuration.
Thank you very much for the help!
Leon