Skip to main content



      Home
Home » Archived » Visual Editor (VE) » loading large amount of data into jTable
loading large amount of data into jTable [message #49120] Fri, 09 July 2004 10:48 Go to next message
Eclipse UserFriend
Originally posted by: lim.hock-chai.arch.com

I've two questions regarding loading large amount of data to jTable:


Currently, I load the data into a Vector. The Vector is then passed to a
class that extend AbstractTableModel. This works well, however, I encounter
the following two problem:


1) When user's request result in a large amount of data, the program
receives java.lang.OutOfMemoryError. What is the typical way of handle this
in jTable?


2) I would like to display the table to the user as the data is being
loaded, much like open a large Excel spreadsheet, user is able to scroll
down as the data continue to load.


thanks



Note (Please let me know if I'm not supposed to post this type of question
to this list. )
Re: loading large amount of data into jTable [message #49149 is a reply to message #49120] Fri, 09 July 2004 10:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

This is for the VE and not for java usages questions.
--
Sorry, Rich Kulp

Re: loading large amount of data into jTable [message #49241 is a reply to message #49120] Fri, 09 July 2004 12:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: myersj.nospam.us.ibm.com

I'd recommend posting this question in the forums of the Java Desktop
community: http://community.java.net/javadesktop/

- Jeff

Hock-Chai Lim wrote:
> I've two questions regarding loading large amount of data to jTable:
>
>
> Currently, I load the data into a Vector. The Vector is then passed to a
> class that extend AbstractTableModel. This works well, however, I encounter
> the following two problem:
>
>
> 1) When user's request result in a large amount of data, the program
> receives java.lang.OutOfMemoryError. What is the typical way of handle this
> in jTable?
>
>
> 2) I would like to display the table to the user as the data is being
> loaded, much like open a large Excel spreadsheet, user is able to scroll
> down as the data continue to load.
>
>
> thanks
>
>
>
> Note (Please let me know if I'm not supposed to post this type of question
> to this list. )
>
>
Re: loading large amount of data into jTable [message #49256 is a reply to message #49120] Sat, 10 July 2004 04:38 Go to previous message
Eclipse UserFriend
Hock-Chai,

This is not a list about Swing... but I think I can help you.

If your data comes from a database, try to subclass AbstractTableModel
and
use for example
" connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE ,
ResultSet.CONCUR_READ_ONLY)". If you have problems, send me a mail and
I'll send you a table model based on an scrollable cursor. The gain is a
600 % over
the Vector approach. DefaultTableModel is not a very good solution even
for few records. Try to use a model based, for example, in ArrayLists. The
gain over DefaultTableModel is aprox a 20 %.

And please, don't use this list to ask other than VE.

Francesc

Hock-Chai Lim wrote:

> I've two questions regarding loading large amount of data to jTable:


> Currently, I load the data into a Vector. The Vector is then passed to a
> class that extend AbstractTableModel. This works well, however, I encounter
> the following two problem:


> 1) When user's request result in a large amount of data, the program
> receives java.lang.OutOfMemoryError. What is the typical way of handle this
> in jTable?


> 2) I would like to display the table to the user as the data is being
> loaded, much like open a large Excel spreadsheet, user is able to scroll
> down as the data continue to load.


> thanks



> Note (Please let me know if I'm not supposed to post this type of question
> to this list. )
Re: loading large amount of data into jTable [message #594855 is a reply to message #49120] Fri, 09 July 2004 10:54 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

This is for the VE and not for java usages questions.
--
Sorry, Rich Kulp

Re: loading large amount of data into jTable [message #594865 is a reply to message #49120] Fri, 09 July 2004 12:41 Go to previous message
Eclipse UserFriend
I'd recommend posting this question in the forums of the Java Desktop
community: http://community.java.net/javadesktop/

- Jeff

Hock-Chai Lim wrote:
> I've two questions regarding loading large amount of data to jTable:
>
>
> Currently, I load the data into a Vector. The Vector is then passed to a
> class that extend AbstractTableModel. This works well, however, I encounter
> the following two problem:
>
>
> 1) When user's request result in a large amount of data, the program
> receives java.lang.OutOfMemoryError. What is the typical way of handle this
> in jTable?
>
>
> 2) I would like to display the table to the user as the data is being
> loaded, much like open a large Excel spreadsheet, user is able to scroll
> down as the data continue to load.
>
>
> thanks
>
>
>
> Note (Please let me know if I'm not supposed to post this type of question
> to this list. )
>
>
Re: loading large amount of data into jTable [message #594884 is a reply to message #49120] Sat, 10 July 2004 04:38 Go to previous message
Eclipse UserFriend
Hock-Chai,

This is not a list about Swing... but I think I can help you.

If your data comes from a database, try to subclass AbstractTableModel
and
use for example
" connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE ,
ResultSet.CONCUR_READ_ONLY)". If you have problems, send me a mail and
I'll send you a table model based on an scrollable cursor. The gain is a
600 % over
the Vector approach. DefaultTableModel is not a very good solution even
for few records. Try to use a model based, for example, in ArrayLists. The
gain over DefaultTableModel is aprox a 20 %.

And please, don't use this list to ask other than VE.

Francesc

Hock-Chai Lim wrote:

> I've two questions regarding loading large amount of data to jTable:


> Currently, I load the data into a Vector. The Vector is then passed to a
> class that extend AbstractTableModel. This works well, however, I encounter
> the following two problem:


> 1) When user's request result in a large amount of data, the program
> receives java.lang.OutOfMemoryError. What is the typical way of handle this
> in jTable?


> 2) I would like to display the table to the user as the data is being
> loaded, much like open a large Excel spreadsheet, user is able to scroll
> down as the data continue to load.


> thanks



> Note (Please let me know if I'm not supposed to post this type of question
> to this list. )
Previous Topic:Is there any Scedule for VE Built Release 1.0?
Next Topic:VE Swing Problem: BoxLayout can't be shared
Goto Forum:
  


Current Time: Sat May 10 07:31:11 EDT 2025

Powered by FUDForum. Page generated in 0.03683 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top