Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-3406 - Fixed ClassCastException on iterating result set for the FunctionMultiReturn.polar2CartesianArray call #3407

Merged
merged 3 commits into from
Jan 29, 2022

Conversation

mans2singh
Copy link
Contributor

Fixed class cast exception by casting to JdbcArray.

@@ -68,7 +69,7 @@ public static void main(String... args) throws Exception {
double r = rs.getDouble(1);
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