public static PreparedStatement preparedStatementToSelectFileSources(DbClient dbClient, DbSession session, String dataType, @Nullable String projectUuid) throws SQLException { String sql = createSQL(dataType, projectUuid); // rows are big, so they are scrolled once at a time (one row in memory at a time) PreparedStatement stmt = dbClient.getMyBatis().newScrollingSingleRowSelectStatement(session, sql); if (projectUuid != null) { stmt.setString(1, projectUuid); } return stmt; }