private In copyIfNecessary(In record) {
        return serializer == null ? record : serializer.copy(record);
    }
Connects to the target database and initializes the prepared statement.

@param taskNumber The number of the parallel instance.
inlong-sort/sort-flink/sort-flink-v1.18/sort-connectors/jdbc/src/main/java/org/apache/inlong/sort/jdbc/internal/JdbcOutputFormat.java