0

If netbeans ide has a queryproperty set to
SELECT c FROM Content c
How can I change this query to say ..limit the resultset to less records like 10 or 20 instead of the whole database.

I am not sure what that SQL string would look like.

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by ceyesuma
0

If your database supports the "TOP" clause, you can use that. If not, then this is usually done by calling setMaxRows() on the Statement object in JDBC. Since you are using beans binding, I have no idea what to tell you because I don't have any api docs for that model and I've never touched it.

Edit: If you're using the Persistence API Query object, there is a setMaxResults() method available.

0

setMaxResults()
that seems very logical I will explore this.
Thanks
-Steve

0

exellent. query.setMaxResults(10); is my first manipulation of the original query.

now I must create a new query.
Thanks
-Steve

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.