Re: Retrieving objects from ResultSet and Casting them to arrays
Posted by: Mark Matthews
Date: March 31, 2005 12:47PM

upendra chintala wrote:
> Hi all,
>
> In my application I need to store a float array
> into a database table(InnoDB). The insertion goes
> well. But the Retrieval gives ClassCastException.
> Please Help me ......
>
> MySQL Server version : 4.0.17
>
> The code is like this.
>
> Insertion Part
> -------------
> float [][]data = { {4.0f, 5.0f}, {6.0f, 7.0f}} ;
>
> Get Connection code....
>
> PreparedStatement(pst) code .....
>
> pst.setObject (parameterIndex, data) ;
>
> This works fine with All connectors.
>
> Retrieving data
> ---------------
> Get Connection code.....
> Statement code ......
> ResultSet code ......
>
> float [][]data = (float
> [][])rs.getObject(parameterIndex) ;
>
> This statement is giving the ClassCastException
> with 3.1.5 connector and above.
>
> With 3.0.7 Connector all the above works fine.

Upendra,

From the CHANGES file for 3.1.5:

" Make auto-deserialization of java.lang.Objects stored in BLOBs
configurable via 'autoDeserialize' property (defaults to 'false')."

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject
Written By
Posted
Re: Retrieving objects from ResultSet and Casting them to arrays
March 31, 2005 12:47PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.