• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Reading files using Pagination

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check this site www.roseindia.net/java/ for your problem...
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic