Skip to content

Conversation

@mans2singh
Copy link
Contributor

Fixed class cast exception by casting to JdbcArray.

double a = rs.getDouble(2);
Object o = rs.getObject(3);
Object[] xy = (Object[]) o;
Object[] xy = (Object[])((JdbcArray) o).getArray();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JdbcArray is an internal class, it shouldn't be used here.

java.sql.Array or Double[] should be used instead.

Array o = rs.getArray(3);
// or
Double[] xy = rs.getObject(3, Double[].class);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @katzyn - I've updated the code based on your recommendations. Please let me know if you have any other recommendations. Thanks for your time.

@katzyn
Copy link
Contributor

katzyn commented Jan 29, 2022

Thanks!

@katzyn katzyn merged commit b5203df into h2database:master Jan 29, 2022
@mans2singh
Copy link
Contributor Author

Thanks for your time @katzyn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants