Retrieving objects from ResultSet and Casting them to arrays
Posted by: upendra chintala
Date: March 31, 2005 10:53AM

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.

Options: ReplyQuote


Subject
Written By
Posted
Retrieving objects from ResultSet and Casting them to arrays
March 31, 2005 10:53AM


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.