• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading files using Pagination

 
monica singh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a file to read from,say 50000 records.
I do not have any database maintained for my application.
Can i display the file data on the UI using pagination mechanism.

If so,how could I do that.
 
Gabriel Arun Rayappan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check this site www.roseindia.net/java/ for your problem...
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ Gabriel: Roseindia has a pretty poor reputation. There are far better resources on the net.

@ Monica: I take it you are still trying to solve your memory leak?
Absent any framework all you do is decide how many records fit on a page, read that many records from the file and display them (it helps if they are fixed-size records because you can use RandomAccessFile and jump to any "page" in the file).
If you don't have fixed size records, it may make sense to build an index of the positions of page starts in the file rather than trying to read forwards and backwards constantly.
There's a good example in Java Swing, though it uses a database for the data source it will give you the general idea.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!