Przygotowana partia Java MySQL

Staram się korzystać z partii readyStatement, ale mam problem.

Poniższy kod nie daje mi błędów, ale wstawia do tabeli tylko ostatni klucz mapy i nie wiem dlaczego.

Z pewnością będzie to bardzo głupi błąd, ale po raz pierwszy używam metody addBatch ().

        Class.forName("com.mysql.jdbc.Driver");
        this.connect = DriverManager.getConnection("jdbc:mysql://localhost/" + this.database + "?user=" + this.user + "&password=" + this.password);
        String s;
        for (String key : this.map.keySet())
        {
            s = ("insert into " + this.database + ".user (nickname) values (?)");
            this.preparedStatement = this.connect.prepareStatement(s);
            this.preparedStatement.setString(1, key);
            this.preparedStatement.addBatch();
        }

        this.preparedStatement.executeBatch();

Z góry dziękuję!

questionAnswers(2)

yourAnswerToTheQuestion