kezhuw commented on a change in pull request #14466:
URL: https://github.com/apache/flink/pull/14466#discussion_r548527255
##########
File path:
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/internal/connection/JdbcConnectionProvider.java
##########
@@ -20,13 +20,40 @@
import org.apache.flink.annotation.Internal;
import java.sql.Connection;
+import java.sql.SQLException;
/**
* JDBC connection provider.
*/
@Internal
public interface JdbcConnectionProvider {
- Connection getConnection() throws Exception;
+ /**
+ * Get existing connection.
+ *
+ * @return existing connection
+ */
+ Connection getExistingConnection();
Review comment:
This method currently exist for reasons:
* Bypass java checked exception restriction and serve as drop-in replacement
for old `connection` field in migrating classes.
* Test access with no side effect to wrapped connection in
`JdbcInputFormat.getDbConn`, `AbstractJdbcOutputFormat.getConnection`,
`JdbcLookupFunction.getDbConnection` and
`JdbcRowDataLookupFunction.getDbConnection` without resort to cast or
additional `VisibleForTesting`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]