Error SQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘?)INSERT INTO Clientes(nome) VALUES(?)’ at line 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:768)
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:653)
at uni.jdbc.preparedStatement.Main.main(Main.java:46)

Repeat query when conditions aren’t met

I am making a kindof quiz. The quiz has 15 questions, for the quiz I need 5 questions of quiztype ‘1’, 5 of quizType ‘2’ and 5 of quizType ‘3’. Right now I’m counting quiztype ‘1’and quiztype ‘2’ trough a loop and if conditions outside the loop aren’t met, I get 15 new entry’s and repeat the loop. I’m wondering, is there a better way to do this inside my query instead of using 2 objects?
This Is my code: