Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access and selecting boolean

 
Martin Schneider
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Verify that you are doing the appropriate cast. Did you try getBoolean?
 
Martin Schneider
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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));
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic