wood burning stoves 2.0*
The moose likes JDBC and the fly likes Access and selecting boolean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Access and selecting boolean" Watch "Access and selecting boolean" New topic
Author

Access and selecting boolean

Martin Schneider
Ranch Hand

Joined: May 16, 2002
Posts: 42
Hi again,
I have a strange problem. I cant get from the db a boolean variable to the table (Im using Vectors and db is access). Errormessage:
java.lang.ClassCastException: java.lang.String
at javax.swing.JTable$BooleanRenderer.getTableCellRendererComponent(JTable.java:3390)
at javax.swing.JTable.prepareRenderer(JTable.java:3682)
at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)
at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
If sourcecode is needed I can paste it also
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Verify that you are doing the appropriate cast. Did you try getBoolean?


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Martin Schneider
Ranch Hand

Joined: May 16, 2002
Posts: 42
I tried getBoolean also but it didnt work either. However, I managed to solve the problem by checking if a result is 0 or 1 and according that subV.addElement(new Boolean(false/true));
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Access and selecting boolean
 
Similar Threads
populate data from database into a jtable
updating database cause error
Swing JCombobox and JTable issue
Validate JTable edit
jTable, Table Models, Data : Can anyone explain how to use them?