[ajug-members] JTables with large amounts of data

Angus Berry angus.berry at elken.com
Mon Nov 8 12:41:39 EST 2004


You might want to look into 'lazy loading' in Hibernate, as an option.
There's an enormous amount of background work done for you in most ORM
products like Hibernate. 

On Mon, 2004-11-08 at 12:27, Sanjay Agravat wrote:
> Use a SwingWorker Thread to retrieve the records in the background. 
> Here is a link to find out how to use it:
> http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html
> 
> You can download it here:
> http://java.sun.com/docs/books/tutorial/uiswing/misc/example-1dot4/SwingWorker.java
> 
> 
> Sanjay
> 
> 
> On Mon, 8 Nov 2004 09:31:53 -0500, Parna Hiram <parna.hiram at gmail.com> wrote:
> > Hi.  I'm working on a PRM application for doctors that uses hibernate
> > and accesses PostgreSQL. I'm designing a screen that simply displays a
> > JTable view of a list of  Patient objects, which at the top level
> > corresponds to the PATIENT table.
> > 
> > The problem is, the PATIENT table is approximately 98,000 records
> > long, and my boss wants, by default for the table to be fully
> > populated from the user's perspective. So,
> > when the screen loads, the table is populated with a "from Patient"
> > query.  There is
> > a text field at the bottom of the screen, and if the user types some
> > text into that
> > textfield and presses enter, the query becomes "from Patient as
> > patient where patient.lastName like 'textfieldcontents%'".
> > 
> > The initial load of the screen currently takes a long time, because it's pulling
> > back 98K records.  Is there a best way of handling this sort of data
> > display, sort of "behind the scenes" pagination?  The way I envision
> > it is to only
> > pull back 1000 or so records, and as the user scrolls down the JTable
> > and nears a
> > point where the table would appear empty, the model would then pull in
> > another 1000
> > records, and so on.  Thanks for your attention to this matter.
> > 
> > Thanks,
> > Parna
> > _______________________________________________
> > ajug-members mailing list
> > ajug-members at ajug.org
> > http://www.ajug.org/mailman/listinfo/ajug-members
> >
> _______________________________________________
> ajug-members mailing list
> ajug-members at ajug.org
> http://www.ajug.org/mailman/listinfo/ajug-members
> 




More information about the ajug-members mailing list