I am using JBOSS 4.0.5 along with MySQL5. While trying to read BLOB values from the database from a stateless session bean, using rs.getObject("columnName"), we get the result as Byte[] instead of the actual object type. Hence ClassCastException
java.lang.ClassCastException : [B
Is there anyway to solve the issue by making changes in the JBoss settings rather than from code. A quick response will be appreciated. Thank you
The getObject method returns data in the format specified by the column in the database. Because the database column type is BLOB, getObject returns byte[]. If that data is a serialized Java object, you will have to unserialize it yourself in code.