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

Johannes Döbler duke at openjdk.org
Wed Oct 15 21:28:33 UTC 2025


On Wed, 15 Oct 2025 20:20:57 GMT, Lance Andersen <lancea at openjdk.org> wrote:

>> src/java.sql/share/classes/java/sql/Statement.java line 1627:
>> 
>>> 1625:     */
>>> 1626:     default String enquoteNCharLiteral(String val) throws SQLException {
>>> 1627:         return SQLUtils.enquoteNCharLiteral(val);
>> 
>> Suggestion: `return getConnection().enquoteNCharLiteral(val);` to allow JDBC driver implementors have a single site to override behavior
>
> No plans to do that in the default implementation.  Driver vendors can/should optimize as needed based on their driver implementation.

Hi @LanceAndersen,
don*t know what you mean with " Driver vendors can/should optimize as needed based on their driver implementation."
My idea was that in JDBC 4.5 the default methods Statement.enquoteNCharLiteral and Statement.enquoteIdentifier could call the new corresponding default methods in Connection, therefore easing life of JDBC vendor or test libraries to have a **_single_** site to override.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27693#discussion_r2434000788


More information about the core-libs-dev mailing list