~/ 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/6b691496-30e0-414d-84d2-d9356b283af9/flashcard utf-8 LF