This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC 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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "LIMIT in Hypersonic and MySQL." Watch "LIMIT in Hypersonic and MySQL." New topic
Author

LIMIT in Hypersonic and MySQL.

Chris Harris
Ranch Hand

Joined: Sep 21, 2003
Posts: 231
Hi,

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

Thanks

Chris.


SCJP 1.2, SCWCD, SCBCD
Srinivas Gogineni
Greenhorn

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

Thx and regards
-Srini
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 ]

http://home.arcor.de/hirnstrom/bewerbung
Albert Gan
Greenhorn

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: http://aspose.com/file-tools
 
subject: LIMIT in Hypersonic and MySQL.