Board index » jbuilder » Row out of range Error when re-opening query dataset

Row out of range Error when re-opening query dataset


2005-11-29 06:57:25 PM
jbuilder17
I have a query dataset that I open with an SQL statement. When opened the first time, it works fine, but everytime I close it and re-open it, it throws an "Row out of range" error. I tested the query in SQL Server, and they work fine. There is nothing complicated in it, just a plain SQL statement that gets modified depending on the item I want to retrieve.
As a work-around I tried to reassign the Querydataset, and that seemed to work at first, but causes another problem. To work correctly I have to assign setMetaDataUpdate again and the column information. But even though I set it to null and reassigned the QueryDataset(), it still thinks it has the column information assigned and throws an error when I try to assign them again (this is strange, because I even tried to explicitly set it to null before reassigning, just to make sure there is no leftover).
The code is below, the commented code is what I tried as an alternative:
String sql = "SELECT * FROM msoEquipFMEA WHERE eqnum = '" + msoEqNum + "' AND siteid = '" + this.msoSiteID + "'";
qdsEquipFMEA.close();
//qdsEquipFMEA = null;
//qdsEquipFMEA = new QueryDataSet();
qdsEquipFMEA.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(msoDB.
getDatabase1(), sql, null, true,
Load.ALL));
/* qdsEquipFMEA.setMetaDataUpdate(MetaDataUpdate.TABLENAME +
MetaDataUpdate.PRECISION +
MetaDataUpdate.SCALE +
MetaDataUpdate.SEARCHABLE);
qdsEquipFMEA.setColumns(new Column[] {column3, column4}); */
qdsEquipFMEA.open();
 
 

Re:Row out of range Error when re-opening query dataset

Ben wrote:
Quote
I have a query dataset that I open with an SQL statement. When opened the
first time, it works fine, but everytime I close it and re-open it, it
throws an "Row out of range" error. I tested the query in SQL Server, and
they work fine. There is nothing complicated in it, just a plain SQL
statement that gets modified depending on the item I want to retrieve.
Can you post a stack trace? That would give us a better idea of what's
going on.
--
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:Row out of range Error when re-opening query dataset

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 excelreader2.msoAssignFMEA.jBtnAssignFMEA_actionPerformed(msoAssignFMEA.java:278)
at excelreader2.msoAssignFMEA_jBtnAssignFMEA_actionAdapter.actionPerformed(msoAssignFMEA.java:312)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
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:3198)
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(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.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)
"Kevin Dean [TeamB]" < XXXX@XXXXX.COM >wrote:
Quote
Ben wrote:

>I have a query dataset that I open with an SQL statement. When opened the
>first time, it works fine, but everytime I close it and re-open it, it
>throws an "Row out of range" error. I tested the query in SQL Server, and
>they work fine. There is nothing complicated in it, just a plain SQL
>statement that gets modified depending on the item I want to retrieve.

Can you post a stack trace? That would give us a better idea of what's
going on.

--
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}

Re:Row out of range Error when re-opening query dataset

Ben wrote:
Quote
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)
I thought as much. That's an old problem. Check out various solutions on
Google:
groups.google.ca/groups
--
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