wanglijie95 commented on a change in pull request #12427:
URL: https://github.com/apache/flink/pull/12427#discussion_r436310785



##########
File path: 
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/internal/executor/InsertOrUpdateJdbcExecutor.java
##########
@@ -83,6 +88,21 @@ public void open(Connection connection) throws SQLException {
                updateStatement = connection.prepareStatement(updateSQL);
        }
 
+       @Override
+       public void reopen(Connection connection) throws SQLException {
+               try {
+                       existStatement.close();
+                       insertStatement.close();
+                       updateStatement.close();
+               } catch (SQLException e) {
+                       LOG.info("PreparedStatement close failed.", e);
+               }
+
+               existStatement = connection.prepareStatement(existSQL);
+               insertStatement = connection.prepareStatement(insertSQL);
+               updateStatement = connection.prepareStatement(updateSQL);

Review comment:
       > Then I suggest to call them `prepareStatements(Connection)` and 
`closeStatements(Connection)`.
   
   OK, I will rename them.




----------------------------------------------------------------
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]


Reply via email to