feat: improve ResultSet#getObject(int, Class) #932
Merged
Conversation
0ad8ac6
to
bd53fed
Codecov Report
@@ Coverage Diff @@
## master #932 +/- ##
===========================================
+ Coverage 65.88% 65.9% +0.02%
- Complexity 3556 3560 +4
===========================================
Files 166 166
Lines 15223 15238 +15
Branches 2458 2464 +6
===========================================
+ Hits 10030 10043 +13
+ Misses 4024 4023 -1
- Partials 1169 1172 +3 |
bd53fed
to
7c73c07
@@ -3166,13 +3166,15 @@ public void updateArray(String columnName, Array x) throws SQLException { | |||
if (sqlType == Types.NUMERIC || sqlType == Types.DECIMAL) { | |||
return type.cast(getBigDecimal(columnIndex)); | |||
} else { | |||
throw new SQLException("conversion to " + type + " from " + sqlType + " not supported"); | |||
throw new PSQLException(GT.tr("Unsupported type conversion to {1}.", type), |
marschall
Sep 25, 2017
Author
Contributor
done
done
7c73c07
to
7b3b0e2
@@ -3166,13 +3166,15 @@ public void updateArray(String columnName, Array x) throws SQLException { | |||
if (sqlType == Types.NUMERIC || sqlType == Types.DECIMAL) { | |||
return type.cast(getBigDecimal(columnIndex)); | |||
} else { | |||
throw new SQLException("conversion to " + type + " from " + sqlType + " not supported"); | |||
throw new PSQLException(GT.tr("conversion to {1} from {2} not supported", type, sqlType), |
vlsi
Sep 25, 2017
Member
Are you sure placeholders are 1-based?
We use MessageFormat (
), and it is 0-based (see https://docs.oracle.com/javase/7/docs/api/java/text/MessageFormat.html )
Are you sure placeholders are 1-based?
We use MessageFormat (
marschall
Sep 25, 2017
Author
Contributor
I must have copy and pasted from the wrong place, eg. https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L349
Fixed
I must have copy and pasted from the wrong place, eg. https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/jdbc/TimestampUtils.java#L349
Fixed
In the review of #813 various issues with the initial implementation of CallableStatement#getObject(int, Class) showed up that ResultSet#getObject(int, Class) also has. This commit gives both methods the same behavior. This commit contains the following changes - make errors localizable - add support for SMALLINT <-> Short - add support for BIGINT <-> BigInteger - add support for TIMESTAMP <-> java.util.Date - swap INTEGER and SMALLINT position
7b3b0e2
to
381aa85
rhavermans
added a commit
to bolcom/pgjdbc
that referenced
this pull request
Jul 13, 2018
In the review of pgjdbc#813 various issues with the initial implementation of CallableStatement#getObject(int, Class) showed up that ResultSet#getObject(int, Class) also has. This commit gives both methods the same behavior. This commit contains the following changes - make errors localizable - add support for SMALLINT <-> Short - add support for BIGINT <-> BigInteger - add support for TIMESTAMP <-> java.util.Date - swap INTEGER and SMALLINT position
rhavermans
added a commit
to bolcom/pgjdbc
that referenced
this pull request
Jul 13, 2018
In the review of pgjdbc#813 various issues with the initial implementation of CallableStatement#getObject(int, Class) showed up that ResultSet#getObject(int, Class) also has. This commit gives both methods the same behavior. This commit contains the following changes - make errors localizable - add support for SMALLINT <-> Short - add support for BIGINT <-> BigInteger - add support for TIMESTAMP <-> java.util.Date - swap INTEGER and SMALLINT position
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
In the review of #813 various issues with the initial implementation of
CallableStatement#getObject(int, Class) showed up that
ResultSet#getObject(int, Class) also has. This commit gives both
methods the same behavior.
This commit contains the following changes