There are two basic approaches.
The most efficient is to do the pagination in the database. You will need to implement something like this:
public long countMyData(..query params..);
public Object[] loadMyDataPage(..query params.., long startIndex, long count);
Having those two methods, you then render the page controls on the page based on the number of results from countMyData(). When user selects a new page you get the data for that page only using loadMyDataPage() with correct startIndex and count.
You also want to make sure that the query is relatively "steady" - the result will be mostly same when it's called time after time. The simplest way to do that is to make sure you sort the result on something sensible - like topic date for forum software or something like that. Otherwise the items will "jump" around.
Second approach is to just load everything in one go and store it in some cache, and then display from there. The problem is that it is highly wasteful especially if it's unique per visitor, so you need to be careful not to waste all memory if you try to do it this way.