row limits in derby?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

row limits in derby?

grafpoo
from what i can tell, and from looking at the hibernate DerbyDialect, derby does not support "row limit" queries, i.e. queries where i restrict the returned rows to some chunk (e.g. "first 20 rows" or "rows 51-100").

true?

sidenote: row limits - is that what they are called? if not, that could explain why i can't find any reference to them in the docs

thnaks



Reply | Threaded
Open this post in threaded view
|

Re: row limits in derby?

Bernt M. Johnsen
>>>>>>>>>>>> [hidden email] wrote (2005-05-06 18:24:11): from
>what i can tell, and from looking at the hibernate DerbyDialect,
>derby does not support "row limit" queries, i.e. queries where i
>restrict the returned rows to some chunk (e.g. "first 20 rows" or
>"rows 51-100").
>
> true?
>
> sidenote: row limits - is that what they are called? if not, that
> could explain why i can't find any reference to them in the docs
>
> thnaks

Maybe not exactly what you're askin for, but JDBC Statement has two
methods for limiting the number of rows fetched, depending on what you
actually want:

        void setMaxRows(int max)
          Sets the limit for the maximum number of rows that any
          ResultSet object can contain to the given number.

        void setFetchSize(int rows)
          Gives the JDBC driver a hint as to the number of rows that
          should be fetched from the database when more rows are
          needed.



--
Bernt Marius Johnsen, Database Technology Group, Sun Microsystems, Norway
Reply | Threaded
Open this post in threaded view
|

Re: row limits in derby?

grafpoo
In reply to this post by grafpoo
thanks, but that's only half of it. need to also be able to start in the middle (i.e. we're paginating results). i was surprised that derby didn't have this, as it's been a while since i've seen a db that didn't...

i am using hibernate and wnated to try derby on the backend, but need this functionality. i don't mind extending hibernate's DerbyDialect, just don't know if it can be done or how.



> >>>>>>>>>>>> [hidden email] wrote (2005-05-06 18:24:11): from
> >what i can tell, and from looking at the hibernate DerbyDialect,
> >derby does not support "row limit" queries, i.e. queries where i
> >restrict the returned rows to some chunk (e.g. "first 20 rows" or
> >"rows 51-100").
> >
> > true?
> >
> > sidenote: row limits - is that what they are called? if not, that
> > could explain why i can't find any reference to them in the docs
> >
> > thnaks
>
> Maybe not exactly what you're askin for, but JDBC Statement has two
> methods for limiting the number of rows fetched, depending on what you
> actually want:
>
> void setMaxRows(int max)
>           Sets the limit for the maximum number of rows that any
>           ResultSet object can contain to the given number.
>
> void setFetchSize(int rows)
>           Gives the JDBC driver a hint as to the number of rows that
>           should be fetched from the database when more rows are
>           needed.
>
>
>
> --
> Bernt Marius Johnsen, Database Technology Group, Sun Microsystems, Norway