private void checkConnectionOpen() {
        try {
            if (!connection.isValid(10)) {
                LOG.info("db connection reconnect..");
                connection = JdbcConnectionUtil.getConnectionWithRetry(
                    driverName,
                    dbURL,
                    username,
                    password
                );
                jdbcWriter.prepareStatement(connection);
            }
        } catch (SQLException e) {
            LOG.error("check connection open failed..", e);
        }
    }
Connects to the target database and initializes the prepared statement.

@param taskNumber The number of the parallel instance.
@throws IOException Thrown, if the output could not be opened due to an
                    I/O problem.
rdb/rdb-sink/src/main/java/com/dtstack/flink/sql/sink/rdb/format/JDBCUpsertOutputFormat.java