Skip to content

Conversation

@goprean
Copy link
Contributor

@goprean goprean commented Apr 10, 2025

According to the 4.3 spec we should be able to get an int value from result set, using resultSet.getInt(...), if the column has the following JDBC types: TINYINT, SMALLINT, INTEGER, BIGINT, REAL, FLOAT, DOUBLE, DECIMAL, NUMERIC, BIT, BOOLEAN, CHAR, VARCHAR, LONGVARCHAR.

If the value of the column is null, it should return 0.
If the value of the column is greater than integer (like for the case of BIGINT, FLOAT, etc) we should return Integer.MAX_VALUE or Integer.MIN_VALUE.

Also the getObject should be used to get an integer out of a column with 2 overloaded methods. (in this case I have not added the negative tests cases).

@goprean goprean self-assigned this Apr 10, 2025
@goprean goprean requested a review from a team as a code owner April 10, 2025 12:39
@sonarqubecloud
Copy link

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.

4 participants