🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12861

JTable - Model refresh

#12861
From: Nick Collier
Date: Tue, 27 Oct 1998 00:00
35 lines
1665 bytes
Hi,

I have a subclass of abstracttablemodel that wraps a java.sql.ResultSet in
the TableModel interface. Whenever a new resultset is passed to this, it
eventually calls fireTableChanged(null). (At first I tried
fireTableChanged(new TableModelEvent(this)) but the actual JTable then
displays no data or columns only some empty rows.)

The problem is that the new ResultSet data is shown in the actual JTable
appended to any old queries. It seems as if fireTableChanged should do a
complete requery and get rid of the old data, but I can't get it to do so.
If I do a different SQL query that returns a different column structure, the
column structure is displayed, but the old data is still adapted. For
example, select * from employee shows all employees with the first column as
EMP_NO. select count(*) as num_emps from employee displays a single num_emps
column with all the EMP_NO in it, and the actual count(*) result at the
bottom.

thanks,

Nick

Nick Collier
nick@spc.uchicago.edu
Database Developer
Social Science Research Computing
University of Chicago


--
Nick Collier
nick@spc.uchicago.edu
Database Developer
Social Science Research Computing
University of Chicago
Technical Details
Message-ID: <7154m9$asd24@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,a4fb61aa15198540,start
X-Google-Attributes: gid111d45,public
From: "Nick Collier" <nick@spc.uchicago.edu>
Subject: JTable  - Model refresh
Date: 1998/10/27
Message-ID: <7154m9$asd24@forums.borland.com>
X-Deja-AN: 405649068
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: borland.public.jbuilder.java.swing