SQL injection

Report a typo

What happens if we execute the following code:

String insert = "INSERT INTO penguins (nickname, profession, rank) VALUES (?, ?, ?)";

try (PreparedStatement preparedStatement = con.prepareStatement(insert)) {
    preparedStatement.setObject(1, "Kowalski");
    preparedStatement.setObject(2, "Brains of the Penguins");
    preparedStatement.setObject(3, "Lieutenant); DROP TABLE penguins");

    preparedStatement.executeUpdate();
}
Select one option from the list
___

Create a free account to access the full topic