RFR: 8369432: Add Support for JDBC 4.5 MR [v5]
Lance Andersen
lancea at openjdk.org
Wed Oct 15 13:37:18 UTC 2025
On Wed, 15 Oct 2025 12:22:42 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:
>
> Address additional spacing comments and add Util class for hosting shared default methods
> On Oct 15, 2025, at 7:14 AM, Eirik Bjorsnos ***@***.***> wrote:
>
>
> @eirbjo commented on this pull request.
>
> In src/java.sql/share/classes/java/sql/Connection.java <https://github.com/openjdk/jdk/pull/27693#discussion_r2432168582>:
>
> > + * @param alwaysQuote indicates if a simple SQL identifier should be
> + * returned as a quoted identifier
> + * @return A simple SQL identifier or a delimited identifier
> + * @throws SQLException if identifier is not a valid identifier
> + * @throws SQLFeatureNotSupportedException if the datasource does not support
> + * delimited identifiers
> + * @throws NullPointerException if identifier is ***@***.*** null}
> + *
> + * @since 26
> + */
> + default String enquoteIdentifier(String identifier, boolean alwaysQuote) throws SQLException {
> + int len = identifier.length();
> + if (len < 1 || len > 128) {
> + throw new SQLException("Invalid name");
> + }
> + if (Pattern.compile("[\\p{Alpha}][\\p{Alnum}_]*").matcher(identifier).matches()) {
> Did you consider using String::matches or Pattern:matches here and elsewhere instead of explicit compilation?
>
Pattern::matches invokes Pattern::compile and String::matches invokes Pattern::matches so did not see the benefit when we added the methods originally in JDK 9
> —
> Reply to this email directly, view it on GitHub <https://github.com/openjdk/jdk/pull/27693#pullrequestreview-3339841144>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABQPFO5OI5TCODKKHCXRWAT3XYT73AVCNFSM6AAAAACIUI2SY6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTGMZZHA2DCMJUGQ>.
> You are receiving this because you were mentioned.
>
My best,
Lance
--
Lance Andersen
USTA EMA President and CEO
PTR Professional 5A
USPTA Elite Professional
USTA Global Cardio Tennis-Master Trainer
USRSA
Mobile: 978 857-0446
luckydogtennis.com -- luckydogtennis.com/TennisBlog -- cardiotennis.com
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27693#issuecomment-3406480600
More information about the core-libs-dev
mailing list