I am trying to use criteria.setFirstResult(15); criteria.setMaxResults(50); with MySql DB. But it generate a wrong sql . It put 'top' keyword after "SELECT". Hibernate version I am using is hibernate-3.3.1.jar eg: select top 65 this_.id as id193_0_, this_.abbr as abbr193_0_, this_.nickname as nickname193_0_, this_.business as business193_0_, this_.country as country193_0_, this_.name as name193_0_, this_.attn as attn193_0_, this_.dept as dept193_0_, this_.street as street193_0_, this_.city as city193_0_, this_.phone as phone193_0_, this_.fax as fax193_0_, this_.telex as telex193_0_, this_.limccy as limccy193_0_, this_.exlimit as exlimit193_0_, this_.dellimit as dellimit193_0_, this_.broccy as broccy193_0_, this_.brobasis as brobasis193_0_, this_.fxbrorate as fxbrorate193_0_, this_.optbrorate as optbrorate193_0_, this_.parent as parent193_0_, this_.reuters as reuters193_0_, this_.reference as reference193_0_, this_.tradeable as tradeable193_0_, this_.amenddate as amenddate193_0_, this_.email as email193_0_ from names this_
Exception received is 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 '65 this_.id as id193_0_, this_.abbr as abbr193_0_, this_.nickname as nickname193' at line 1 Please provide a solution to resolve this.
Thanks, SD
|