File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "Access and selecting boolean" Watch "Access and selecting boolean" New topic

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(
at javax.swing.JTable.prepareRenderer(
at javax.swing.plaf.basic.BasicTableUI.paintCell(
at javax.swing.plaf.basic.BasicTableUI.paintCells(
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?

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:
subject: Access and selecting boolean
jQuery in Action, 3rd edition