Returning only limited data from database.
Posted on 2002-06-03
I am using java as programming language and PostgreSQL as my database.
Is it possible to request the database to return only a certain number of records (100 only) based on a Select Query ?
In other words, consider this example :
SELECT name, age, depname from EMPLOYEE, DEPARTMENT
WHERE EMPLOYEE.dept_id = DEPARTMENT.id;
This returns 1500 records.
Is there a way to tell the RDBMS to return only first 100 records ? Also, can i ask it to return next 100 records etc ?
The reason i need this feature is that some of my SQL Queries might return 500,000 records. I wonder if the resultset object in java will be able to handle that much data !
(One thought : What is the behaviour in LDAP. Are such features supported there.)