Board index » jbuilder » JdbTable with empty QueryDataSet problem

JdbTable with empty QueryDataSet problem


2005-03-22 11:46:26 PM
jbuilder19
I have the following situation.
A JdbTable and a QueryDataSet.
Both are singletons and the QueryDataSet is tied to the JdbTable.
The QueryDataSet has a ParameterRow and
isn't executed on open but on explicit request.
The QueryDataSet is refreshed for an initial value of ParameterRows
column.
If the dialog with the JdbTable comes up the first time everything is
ok.
Than the dialog is closed and the column of the ParameterRow of the
QueryDataSet is set to a new value and refreshed.
When the dialog comes up a second time the exception below is thrown.
This happens for every QueryDataSet that is empty for the current
value
the column of the ParameterRow is actually set to.
Has anyone seen this before?
Thanks in advance
Michael
java.lang.IllegalArgumentException: Row index out of range
at javax.swing.JTable.boundRow(JTable.java:1267)
at javax.swing.JTable.setRowSelectionInterval(JTable.java:1290)
at com.borland.dbswing.JdbTable.accessChange(JdbTable.java:2959)
at com.borland.dx.dataset.AccessEvent.dispatch(Unknown Source)
at com.borland.jb.util.EventMulticaster.dispatch(Unknown Source)
at com.borland.dx.dataset.DataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.open(Unknown Source)
at com.borland.dx.dataset.StorageDataSet.refresh(Unknown Source)
at com.borland.dx.sql.dataset.QueryDataSet.refresh(Unknown Source)
at
de.beracom.iqx.db.idee.AttachmentEinerIdee.newQueryParameter(Attachmen
tEinerIdee.java:146)
at
de.beracom.iqx.db.idee.SingleIdee.newQueryParameter(SingleIdee.java:16
3)
at de.beracom.gui.Top100.jdbTable_mouseClicked(Top100.java:154)
at de.beracom.gui.Top100.access$100(Top100.java:17)
at de.beracom.gui.Top100$2.mouseClicked(Top100.java:63)
at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212
)
at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:211
)
at java.awt.Component.processMouseEvent(Component.java:5103)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3207)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThr
ead.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThrea
d.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
 
 

Re:JdbTable with empty QueryDataSet problem

Michael Rachow wrote:
Quote
Has anyone seen this before?

Thanks in advance
Michael

java.lang.IllegalArgumentException: Row index out of range
This is a known problem in the dbSwing library. A search on Google
Groups leads to the following posting:
groups.google.ca/groups
&lr=&safe=off&scoring=d&selm=420d02c1%241%40newsgroups.borland.com&rnum=
1
-- or --
tinyurl.com/57sr4
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

Re:JdbTable with empty QueryDataSet problem

Finally based on the recomended hints I have created a suclass of
JdbTable.
It bypasses the error occuring under these circumstances described in
my first post.
package com.borland.dbswing;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
import de.beracom.sys.log.*;
/**
* Have to use this class until this "useless"
IllegalArgumentException
* for empty DataSets (under certain circumstances) is corrected.
*/
/** @todo Falls into category: Check on regular basis after new
patches and
* updates of JBuilder. */
public class JdbTableEx
extends JdbTable
{
public JdbTableEx() {
super();
}
public JdbTableEx(TableModel dm) {
super(dm);
}
public JdbTableEx(TableModel dm, TableColumnModel cm) {
super(dm, cm);
}
public JdbTableEx(TableModel dm, TableColumnModel cm,
ListSelectionModel sm) {
super(dm, cm, sm);
}
public JdbTableEx(int numColumns, int numRows) {
super(numColumns, numRows);
}
public JdbTableEx(Vector data, Vector columnNames) {
super(data, columnNames);
}
public JdbTableEx(Object[][] data, Object[] columnNames) {
super(data, columnNames);
}
public void setRowSelectionInterval(int i1, int i2) {
try {
if(this.getRowCount()>0)
super.setRowSelectionInterval(i1, i2);
}
catch(IllegalArgumentException iae) {
Log.mailStackTrace(iae);
}
}
}
"Kevin Dean [TeamB]" < XXXX@XXXXX.COM >schrieb im
Newsbeitrag news:xn0e0235ch385q000-kdean@www.teamb.com...
Quote
Michael Rachow wrote:

>Has anyone seen this before?
>
>Thanks in advance
>Michael
>
>java.lang.IllegalArgumentException: Row index out of range

This is a known problem in the dbSwing library. A search on Google
Groups leads to the following posting:


groups.google.ca/groups

&lr=&safe=off&scoring=d&selm=420d02c1%241%40newsgroups.borland.com&rnu
m=
Quote
1

-- or --

tinyurl.com/57sr4

--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/

NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
www.datadevelopment.com/papers/index.html

Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html
 

{smallsort}