12 messages in com.mysql.lists.javaRe: outOfMemoryError| From | Sent On | Attachments |
|---|---|---|
| danilo | 24 Jun 2003 03:02 | |
| Dirk Hillbrecht | 24 Jun 2003 03:07 | |
| dr.ahab | 24 Jun 2003 03:18 | |
| Jeff Mathis | 24 Jun 2003 08:31 | |
| danilo | 25 Jun 2003 08:28 | |
| Mark Matthews | 25 Jun 2003 08:49 | |
| Jeff Mathis | 25 Jun 2003 08:55 | |
| Dirk Hillbrecht | 25 Jun 2003 09:17 | |
| danilo | 25 Jun 2003 09:52 | |
| Mark Matthews | 25 Jun 2003 10:06 | |
| Shankar Unni | 25 Jun 2003 10:09 | |
| Dirk Hillbrecht | 25 Jun 2003 10:36 |
| Subject: | Re: outOfMemoryError![]() |
|---|---|
| From: | Dirk Hillbrecht (dh...@cantamen.de) |
| Date: | 06/25/2003 10:36:39 AM |
| List: | com.mysql.lists.java |
Hi,
[@list: please protest if too off-topic. I would assume this is of general interest as it covers some basic and important design issues on working with databases]
danilo schrieb:
The idea of retrieving only the visible part of table does not fit my needs, because after filling the table I have to do some analisys on it's contents (calculate the sum of each row/column, percentage of each value respect the total), so I need all that stuff at once.!! So (Unlucky) I still have no friend called LIMIT !! ;)
But you have other friends. Perhaps the most important ones here: "SELECT sum(rowname)", "GROUP BY" and "HAVING".
Generally spoken it is simple: If you have to do large computations on the tables in your database, let the database do them. Always(*). If you cannot perform a certain calculation by SELECTing some way or the other, your database design is broken(**).
So, your application should
- let the database compute whatever you need.
- take these values.
- finally combine all the stuff from the database in your GUI.
I already draw the table only once at the end of the query (at least I THINK I do it, what did you mean? looping on all the ResultSet record all at once? if so I did it in that way)
Err... With "draw" you mean doing something like "tablemodel.setData()" or "jtable.setModel()", don't you? You do not call "table.redraw()" or something like this, do you?
Best regards, Dirk
-- --- Dirk Hillbrecht, cantamen GmbH i.Gr., Vahrenwalder Str. 7 ----- 30165 Hannover, Tel.: +49/511/9357-840, Fax: +49/511/9357-849 ----- eMail: dh...@cantamen.de, Web: http://www.cantamen.de --- PGP fingerprint: 71D8 A381 2B69 144B DABA 78A5 D398 1792 D270 13D7




