incubator-empire-db-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele <>
Subject re: Limit Offset clause
Date Tue, 07 Jul 2009 07:43:29 GMT
Hi Frank,

the correct approach for this is to extend the class DBCommandPostreSQL that you already have
as a nested class in DBDatabaseDriverPostgreSQL.

I recommend to promote it to a normal class and then implement the following:
- create getters/setters to set the limit.
- override getSelect(StringBuilder buf) from the base class (DBCommand) in order to add the
limits to the SQL.

In order to use it, however you have to cast the command object returned by DBDatabase.createCommand()
to a DBDatabaseDriverPostgreSQL object, which will make your code PostgreSQL specific. 

We've done similar things with the Oracle command object (see DBCommandOracle).

If it works we would be happy to provide the code with a future release.


Frank Lupo wrote:
> Betreff: Limit Offset clause
> In DBDatabaseDriver is possible to implementig SQL_LIMIT and SQL_OFFSET
> for pagination resul using DBCommand?
> Es. in DBDatabaseDriverPostgreSQL
> in DBCommand get/set Limt and Offset
>  --
>  Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e
> SMTP autenticato? GRATIS solo con
>  Sponsor:
> * Cerchi un hotel per visitare i parchi della Romagna ? Oltremare,
> Aquafan, Mirabilandia e Fiabilandia ti aspettano. Scegli un
> RivieraParkHotels  per la tua vacanza a Riccione.
>  Clicca qui:

View raw message