This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
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

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
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
It's not a secret anymore!