craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > JDBC/Database Issues Post New Topic   Post A Reply
java.sql.Exception: -1 on dBTable.refresh(resultset rs) printer friendly version
next newest post | next oldest post
Author Messages
benjamin
Private

Gender: Unspecified
Location:
Registered: Feb 2009
Status: Offline
Posts: 3

Click here to see the profile for benjamin Send email to benjamin Send private message to benjamin Find more posts by benjamin Edit or delete this message Reply w/Quote
Posted Friday, February 20, 2009 @ 14:00:19  

hello,

I've run into this problem, has this been resolved? I've searched these forums but havent found a solution so far.

Basically I've a JInternalFrame containing 3 Quicktable grids, and one of these is giving me this exception on the 2nd and every subsequent refresh I'm doing on it, the first refresh will run just fine.

The other 2 grids do the same thing, without any problems.

I'm refreshing all grids via resultset.

Its kinda puzzling me, as I do nothing different there, and I've over 15 grids in different frames that all work without problems the same way.

Anyone have an idea what could be the issue?

Error is occuring at:

quick.dbtable.DBTable.refresh(DBTable.java:2887)

Edit: I'm using latest Quicktable version, databse is postgres via JDBC.

Edit2: One thing to add is, despite I get this exception thrown the grid seems to work ok, i.e. the resultset I pass to it is properly displayed.

[Edit by benjamin on Friday, February 20, 2009 @ 14:02:17]

[Edit by benjamin on Friday, February 20, 2009 @ 14:12:32]

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Saturday, February 21, 2009 @ 06:44:05  

did you try to enable debug and check the logs?

Can you post the full exception message & stacktrace?

benjamin
Private

Gender: Unspecified
Location:
Registered: Feb 2009
Status: Offline
Posts: 3

Click here to see the profile for benjamin Send email to benjamin Send private message to benjamin Find more posts by benjamin Edit or delete this message Reply w/Quote
Posted Sunday, February 22, 2009 @ 15:10:18  

I did set dbtable.debug, but it doesnt give me much ouput.

On the initial refresh it will give me this:

Code:

Initializing column properties. Any properties set using getColumn(i).setXXXX() will be lost. To retain old column properties use 'DBTable.useOldColumnProperties(boolean val)', if needed.
Database meta data information received from jdbc driver
Column 1: Name: id
ReadOnly: false
Data Type: INTEGER
Precision: 10
Scale: 0
Signed: true

Column 2: Name: customer
ReadOnly: false
Data Type: VARCHAR
Length: 20

Column 3: Name: finished
ReadOnly: false
Data Type: BIT
Length: 1

Column 4: Name: paid
ReadOnly: false
Data Type: BIT
Length: 1

Everything works to this point.

Subsequent refreshes will just give this:

Code:

Skipping recreating columns. To refresh column properties everytime, use 'DBTable.useOldColumnProperties(boolean val)', if needed.

and this exception stacktrace:

Code:

java.sql.SQLException: -1
at quick.dbtable.DBTable.refresh(DBTable.java:2887)
at desktopapplication2.FrmBill.refreshMasterTable(FrmBill.java:482)
at desktopapplication2.FrmBill.finishBill(FrmBill.java:471)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAction.java:662)
at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.java:698)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

One thing to note is the grid itself seem to have updated correct, as soon as I touch the scrollbar or click into it it will display the new resultset.

benjamin
Private

Gender: Unspecified
Location:
Registered: Feb 2009
Status: Offline
Posts: 3

Click here to see the profile for benjamin Send email to benjamin Send private message to benjamin Find more posts by benjamin Edit or delete this message Reply w/Quote
Posted Saturday, March 7, 2009 @ 00:57:41  

Hello again,

I got the issue resolved, turned out the exception I was given was kind of bogus and did hide the actual cause of the error, which was a call to dBTable.getValueAt() on the selected row while the ListSelectionEvent was thrown without properly checking if a Row was actually selected.

This resulted in NullPointerException inside JTable, which didnt made it to the NetBeans console and I managed not seeing this trivial error. :~

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Saturday, March 7, 2009 @ 02:06:12  

Glad to hear you have resolved this. In next release, we will print the actual exception, which will give us a better way of dealing with these types of errors.
Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios