[ 
https://issues.apache.org/jira/browse/FLINK-20658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17291751#comment-17291751
 ] 

Kezhu Wang commented on FLINK-20658:
------------------------------------

[~jark] Sorry for so late response. I confirmed my previous suspect. I plan to 
following procedure:
 # Filter {{DriverManager.getDrivers()}} by {{driverName}}.
 # Fallback to {{Class.forName(driverName, true, 
Thread.currentThread().getContextClassLoader())}} and {{Class.newInstance}}.
 # Cache filtered/created {{Driver}} in above phases.
 # Enable {{SimpleJdbcConnectionProviderTest.testEstablishDriverConnection}}.

As a side effect, no jdbc compliant driver(eg. not registered in 
{{DriverManager}}) will work. I think this could be useful in certain cases(eg. 
testing or reusing same url without conflict with existing driver). I could 
write tests to assert this behavior.

[~jark] What do you think ?

> Make sure jdbc connection is established by target driver
> ---------------------------------------------------------
>
>                 Key: FLINK-20658
>                 URL: https://issues.apache.org/jira/browse/FLINK-20658
>             Project: Flink
>          Issue Type: New Feature
>          Components: Connectors / JDBC, Table SQL / Ecosystem
>    Affects Versions: 1.13.0
>            Reporter: Kezhu Wang
>            Priority: Major
>             Fix For: 1.13.0
>
>
> Currently, {{SimpleJdbcConnectionProvider.getConnection}} may return 
> connection established by driver different from {{jdbcOptions.driverName}} if 
> there are multiple driver implementations for same jdbc url exist in class 
> path.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to