On Fri, 10 Oct 2025 16:03:23 GMT, Lance Andersen <[email protected]> wrote:
>> src/java.sql/share/classes/java/sql/Connection.java line 1840:
>>
>>> 1838: throw new SQLException("Invalid name");
>>> 1839: }
>>> 1840: }
>>
>> Have you considered creating a non-public class with the implementations so
>> that we don't have the same implementation in Statement and Connection? This
>> would also provide somewhere to cache the compiled Patterns (a candidate for
>> LazyConstant in the future, not now as the java.sql does not participate in
>> preview features at this time).
>
> I hadn't but can look at this for follow on clean up before GA and after CSR
> is approved.
Also from the perspective of a JDBC driver provider it would be beneficial to
have the default implementations in Statement..enquoteLiteral() and
Statement.enquoteIdentifier() call the new methods in Connection. Driver
implementations would then only need to override the Connection methods if they
want to adjust the default implementation.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27693#discussion_r2422747200