[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2954) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException seting setMaxResults
Ignacio Manzano (JIRA)
noreply at atlassian.com
Sat Nov 17 14:35:21 EST 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28872 ]
Ignacio Manzano commented on HHH-2954:
--------------------------------------
In this forum there is an example of this issue
http://forums.mysql.com/read.php?39,88025,88025
Regards,
Ignacio
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException seting setMaxResults
> ------------------------------------------------------------------------------
>
> Key: HHH-2954
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2954
> Project: Hibernate3
> Issue Type: Bug
> Components: query-criteria
> Affects Versions: 3.2.1
> Environment: MySQL 5.0 using JDBC Driver mysql-connector-java-5.1.5-bin.jar
> Reporter: Ignacio Manzano
> Priority: Blocker
>
> When try to set setFirstResult or setMaxResults in a Criteria the following exception appear
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 10 10 this_.id as id3_0_, this_.title as title3_0_, this_.public as public' at line 1
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
> at com.mysql.jdbc.Util.getInstance(Util.java:381)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1031)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837)
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543)
> at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737)
> at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1888)
> at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
> at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
> at org.hibernate.loader.Loader.getResultSet(Loader.java:1778)
> 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:2211)
> ... 79 more
> I tryed set up the following parameter in SQL String but doesn´t work
> useServerPrepStmts=false
> emulateUnsupportedPstmts=false
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list