loading large amount of data into jTable [message #49120] |
Fri, 09 July 2004 14:48 |
Eclipse User |
|
|
|
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 #49241 is a reply to message #49120] |
Fri, 09 July 2004 16:41 |
Eclipse User |
|
|
|
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 08:38 |
Francesc Rosés Messages: 213 Registered: July 2009 |
Senior Member |
|
|
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 #594884 is a reply to message #49120] |
Sat, 10 July 2004 08:38 |
Francesc Rosés Messages: 213 Registered: July 2009 |
Senior Member |
|
|
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. )
|
|
|
Powered by
FUDForum. Page generated in 0.03777 seconds