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
table refresh problem printer friendly version
next newest post | next oldest post
Author Messages
aweber1nj
Private

Gender: Unspecified
Location:
Registered: Feb 2010
Status: Offline
Posts: 4

Click here to see the profile for aweber1nj Send email to aweber1nj Send private message to aweber1nj Find more posts by aweber1nj Edit or delete this message Reply w/Quote
Posted Friday, February 12, 2010 @ 16:28:53  

This must be something simple, because it should be in alot of other code, and is actually in the examples in the javadocs...

When I first populate my table, I set the Connection, setSelectSql, and refresh(). This works fine.

However, when the user selects a different table (from a combobox), I set the new select (setSelectSql) and execute a refresh(), but it always returns a SQLException. The stack trace is as follows, but I don't get much out of it. Even when I change the combobox back to the original DB table, which populated the table the first time just fine, it returns the same SQLException?

Please help?
-AJ

java.sql.SQLException
at quick.dbtable.DBTable.refresh(DBTable.java:2859)
at com.webtek.dbArchive.viewerMain.itemStateChanged(viewerMain.java:115)
at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1162)
at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1219)
at javax.swing.JComboBox.contentsChanged(JComboBox.java:1266)
at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:100)
at javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:88)
at javax.swing.JComboBox.setSelectedItem(JComboBox.java:551)
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:597)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:808)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
at java.awt.Component.processMouseEvent(Component.java:5517)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:476)
at java.awt.Component.processEvent(Component.java:5282)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3984)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1791)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

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 13, 2010 @ 12:24:28  

Actually this exception is thrown when some other error has occured. We will fix this error reporting soon. Original exception is printed only in debug mode, Please enable dbTable.debug=true and run again, you will get the actual error.

In this case, just double check whether you are passing correct sql on combo change.

aweber1nj
Private

Gender: Unspecified
Location:
Registered: Feb 2010
Status: Offline
Posts: 4

Click here to see the profile for aweber1nj Send email to aweber1nj Send private message to aweber1nj Find more posts by aweber1nj Edit or delete this message Reply w/Quote
Posted Monday, February 15, 2010 @ 10:29:28  

OK, I ran with debug enabled. It looks like it returns with a null pointer during the count stmt. NOTE: There are zero rows in this table (but the table does exist).

Having zero rows in the table should not 1) cause a null pointer exception; 2) cause all future execution with the DBTable to fail.

Executing row count sql=SELECT COUNT(*) from patents_email
java.lang.NullPointerException
at org.sqlite.Stmt.executeQuery(Stmt.java:89)
at quick.dbtable.t.for(DBTableModel.java:923)
at quick.dbtable.t.a(DBTableModel.java:610)
at quick.dbtable.DBTable.a(DBTable.java:2685)
at quick.dbtable.DBTable.refresh(DBTable.java:2847)
at com.webtek.dbArchive.viewerMain.itemStateChanged(viewerMain.java:117)
at javax.swing.JComboBox.fireItemStateChanged(JComboBox.java:1162)
at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:1219)
at javax.swing.JComboBox.contentsChanged(JComboBox.java:1266)
at javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:100)
at javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.java:88)
at javax.swing.JComboBox.setSelectedItem(JComboBox.java:551)
at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:597)
at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:808)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
at java.awt.Component.processMouseEvent(Component.java:5517)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:476)
at java.awt.Component.processEvent(Component.java:5282)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3984)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1791)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

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 Tuesday, February 16, 2010 @ 23:58:10  

The null pointer is happenning within your jdbc driver

org.sqlite.Stmt.executeQuery(Stmt.java:89)

can you try any other jdbc driver?

Also refer
http://quicktable.org/discussion/cutecast/cutecast.pl?forum=2&thread=452

aweber1nj
Private

Gender: Unspecified
Location:
Registered: Feb 2010
Status: Offline
Posts: 4

Click here to see the profile for aweber1nj Send email to aweber1nj Send private message to aweber1nj Find more posts by aweber1nj Edit or delete this message Reply w/Quote
Posted Wednesday, February 17, 2010 @ 08:20:42  

I should have looked closer at that stack trace before sending it back. I will check with the JDBC class author.
Thanks,
AJ
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