On Wed, 15 Oct 2025 20:20:57 GMT, Lance Andersen <[email protected]> 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