aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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));
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Access and selecting boolean