RFR: 8369432: Add Support for JDBC 4.5 MR [v4]

Andrey Turbanov aturbanov at openjdk.org
Wed Oct 15 09:34:00 UTC 2025


On Mon, 13 Oct 2025 18:26:40 GMT, Lance Andersen <lancea at openjdk.org> wrote:

>> This PR adds support for the upcoming JDBC 4.5 MR which provides the following  updates to the JDBC specification:
>> 
>> - Deprecate SQLPermission for removal
>> - Enhance the Blob/Clob/Array/SQLXML/NClob interfaces to extend/support AutoClosable
>> - Add the SQL types DECFLOAT, JSON to Types.Java and JDBCType.java
>> - Add the quoted identifier methods that **were added previously to the Statement interface in JDK 9** to the Connection interface
>>   - It is the exact same verbiage & default methods used when these methods were added to the Statement interface
>> - Clarify the Timestamp::hashCode method which incorrectly indicates that nanos are not used when calculating the hash
>> 
>> Tiers 1-3 have been run
>
> Lance Andersen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Round 3 of formating/typo updates

src/java.sql/share/classes/java/sql/Connection.java line 1715:

> 1713:      * @since 26
> 1714:      */
> 1715:     default String enquoteLiteral(String val)  throws SQLException {

Suggestion:

    default String enquoteLiteral(String val) throws SQLException {

src/java.sql/share/classes/java/sql/Connection.java line 1716:

> 1714:      */
> 1715:     default String enquoteLiteral(String val)  throws SQLException {
> 1716:         return "'" + val.replace("'", "''") +  "'";

Suggestion:

        return "'" + val.replace("'", "''") + "'";

src/java.sql/share/classes/java/sql/Connection.java line 1830:

> 1828:         }
> 1829:         if (Pattern.compile("[\\p{Alpha}][\\p{Alnum}_]*").matcher(identifier).matches()) {
> 1830:             return alwaysQuote ?  "\"" + identifier + "\"" : identifier;

Suggestion:

            return alwaysQuote ? """ + identifier + """ : identifier;

src/java.sql/share/classes/java/sql/Connection.java line 1950:

> 1948:      * @since 26
> 1949:      */
> 1950:     default String enquoteNCharLiteral(String val)  throws SQLException {

Suggestion:

    default String enquoteNCharLiteral(String val) throws SQLException {

src/java.sql/share/classes/java/sql/Connection.java line 1951:

> 1949:      */
> 1950:     default String enquoteNCharLiteral(String val)  throws SQLException {
> 1951:         return "N'" + val.replace("'", "''") +  "'";

Suggestion:

        return "N'" + val.replace("'", "''") + "'";

test/jdk/java/sql/testng/test/sql/ConnectionTests.java line 173:

> 171:             {"Bruce Wayne", true, "\"Bruce Wayne\""},
> 172:             {"GoodDay$", false, "\"GoodDay$\""},
> 173:             {"GoodDay$", true, "\"GoodDay$\""},};

Suggestion:

            {"GoodDay$", true, ""GoodDay$""},
        };

test/jdk/java/sql/testng/test/sql/ConnectionTests.java line 187:

> 185:             {"Hello" + '\0', false},
> 186:             {"", false},
> 187:             {maxIdentifier + 'a', false},};

Suggestion:

            {maxIdentifier + 'a', false},
        };

test/jdk/java/sql/testng/test/sql/ConnectionTests.java line 208:

> 206:             {maxIdentifier, true},
> 207:             {maxIdentifier + 'a', false},
> 208:             {"", false},};

Suggestion:

            {"", false},
        };

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27693#discussion_r2431833438
PR Review Comment: https://git.openjdk.org/jdk/pull/27693#discussion_r2431833893
PR Review Comment: https://git.openjdk.org/jdk/pull/27693#discussion_r2431835388
PR Review Comment: https://git.openjdk.org/jdk/pull/27693#discussion_r2431836043
PR Review Comment: https://git.openjdk.org/jdk/pull/27693#discussion_r2431836395
PR Review Comment: https://git.openjdk.org/jdk/pull/27693#discussion_r2431839471
PR Review Comment: https://git.openjdk.org/jdk/pull/27693#discussion_r2431839956
PR Review Comment: https://git.openjdk.org/jdk/pull/27693#discussion_r2431840368


More information about the core-libs-dev mailing list