~/ learn/ java-from-zero/ cards/ executeUpdate, INSERT/UPDATE/DELETE & SQL injection
1 of 4

Type an executeUpdate with two placeholders

Type an executeUpdate with two placeholders

Answer

ps.setDouble(1, 75000.00); ps.setInt(2, 42); int rows = ps.executeUpdate();

executeUpdate returns the count of affected rows (0 if no rows matched). Use it for INSERT, UPDATE, DELETE — never executeQuery for modification statements.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/e17f6566-5fd0-4dc0-a6b0-8b23459362fb/flashcard utf-8 LF