[WARN ] 2010-11-18 11:34:16,359 - org.hibernate.util.JDBCExceptionReporter - SQL

[WARN ] 2010-11-18 11:34:16,359 - org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 24000
[ERROR] 2010-11-18 11:34:16,359 - org.hibernate.util.JDBCExceptionReporter - ResultSet may only be accessed in a forward direction.
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)
在网上搜索一番,发现我穿的参数(startIndex)值的问题。
q.setFirstResult(startIndex);
在sqlserver中,这个(startIndex)不能为负数。如果为负数回报上面的异常错误。

你可能感兴趣的:(java,sql,异常)