diff --git a/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/outputs/csv/CsvOutputFiles.java b/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/outputs/csv/CsvOutputFiles.java index 293233b4..f5222022 100644 --- a/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/outputs/csv/CsvOutputFiles.java +++ b/kraftwerk-core/src/main/java/fr/insee/kraftwerk/core/outputs/csv/CsvOutputFiles.java @@ -20,7 +20,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; -import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; @@ -98,14 +97,9 @@ public void writeOutputTables(Map metadataModels) throws //Count rows for functional log if (kraftwerkExecutionLog != null) { - String selectQuery = "SELECT COUNT(*) FROM ?"; - try(PreparedStatement preparedStatement = getDatabase().getConnection().prepareStatement(selectQuery)) { - preparedStatement.setString(1, datasetName); - try (ResultSet countResult = - preparedStatement.executeQuery()) { - countResult.next(); - kraftwerkExecutionLog.getLineCountByTableMap().put(datasetName, countResult.getInt(1)); - } + try(ResultSet countResult = this.getDatabase().executeQuery("SELECT COUNT(*) FROM " + datasetName)){ + countResult.next(); + kraftwerkExecutionLog.getLineCountByTableMap().put(datasetName, countResult.getInt(1)); } } } catch (SQLException | IOException e) {