0

I have following query that work with oracle:

 SELECT * FROM Company WHERE Company.name LIKE ? AND ROWNUM <= 20;

For Test, I use HSQLDB this query fails and I have the follwing exception:

org.hsqldb.HsqlException: user lacks privilege or object not found: ROWNUM
at org.hsqldb.error.Error.error(Unknown Source) ~[hsqldb-2.3.3.jar:2.3.3]

how can I resolve this problem?

youssef Liouene
  • 873
  • 6
  • 15
  • 28
  • Yes, rownum is something Oracle. To resolve it, don't rely on rownum but use another way to limit the resultset. I'm sure Spring-jdbc has logic for it. – Gimby Jan 07 '16 at 11:32
  • Another good example why it's a bad idea to test on something that you don't use in production. –  Jan 07 '16 at 12:19
  • As already answered, you should turn on the ORA compatibility mode in HSQLDB and it will understand ROWNUM – fredt Jan 07 '16 at 17:02

0 Answers0