You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by saraswathi selvaraj <s_...@yahoo.com> on 2005/11/30 15:37:53 UTC
Converting MySQL Boolean type to Java Boolean type
Hi,
I tried to execute the sample CMP application loan-cmp with a field status type Boolean in mysql 5.0.16.
Iam able to create a record in the database using CMP create() & postCreate().
But when i try to retreive any record using findByPrimaryKey it throws the exception :
[java] java.lang.ClassCastException
[java] at org.openejb.client.CgLibProxy$$EnhancerByCGLIB$$a68aab.getSta
tus(<generated>)
[java] at com.ibm.demo.entity.client.EntityBeanClient.main(EntityBeanCl
ient.java:56)
The problem may be MySQL treats Boolean as tinyint whereas in case of java boolean type is different. So while retrieving the value it's causing ClassCastException.
Can anyone help me in this regard.
Thanks in advance,
S.Saraswathi
---------------------------------
Yahoo! Music Unlimited - Access over 1 million songs. Try it free.