File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes LIMIT in Hypersonic and MySQL. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "LIMIT in Hypersonic and MySQL." Watch "LIMIT in Hypersonic and MySQL." New topic

LIMIT in Hypersonic and MySQL.

Chris Harris
Ranch Hand

Joined: Sep 21, 2003
Posts: 231

I am currently looking at creating a database component that can be used with both Hypersonic and MYSQL. As I am required to execute large statments a need to use the limit SQL keyword.

I have notice a differance between Hypersonic and MySQL. In Hypersonic the syntax is:

However In MySQL the syntax for limit is:

So I can't send the same statements to both database.

I was wondering which one is the standard way for the LIMIT syntax.

Once I know the standard way this should be done I may start looking at the database code for the non-standard one. May even be able to make them both the same



Srinivas Gogineni

Joined: May 06, 2004
Posts: 6
Hypersonic SQL is "In memory database".So it may not statisfy all the sandard SQL notations.

Thx and regards
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

curious argument
mySql doesn't have views and subqueries...

however - the postgresql looks a bit like mySql:

SQL isn't standardized that much, (a nuisance) - perhaps it's wise to look what the market-leader (oracle) is saying?
[ May 27, 2004: Message edited by: Stefan Wagner ]
Albert Gan

Joined: Aug 19, 2003
Posts: 15
As long as i can remembered, the limit syntaxes differ from 1 vendor to another, ex mysql uses keyword limit, oracle uses the rownum function, etc.

It's almost impossible to use standard ways in persistence layer. Perhaps you should code different classes for different database/any other legacy systems, and plug the correct ones to the business process tier. Data Access Object, Inversion of Control/Abstract Factory and Factory pattern could do some help.

good luck to you ^^
I agree. Here's the link:
subject: LIMIT in Hypersonic and MySQL.
It's not a secret anymore!