You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PreparedStatement p = connection.prepareStatement("DELETE from promo_codes WHERE code IN(?, ?, ?)");
p.setString(1, codeOne);
p.setString(2, codeTwo);
p.setString(3, codeThree);
p.executeUpdate();
The placeholder arguments are important. Using normal string concatenation leaves the code open to SQL injection, so we don't want to have string concatenation in our docs. But placeholders in JDBC are cumbersome. JDBI (https://jdbi.org/) lets you do something simpler:
handle.execute("DELETE from promo_codes WHERE code IN(?, ?, ?)", codeOne, codeTwo, codeThree);
We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB docs!
Eric Harmeling (ericharmeling) commented:
@rafiss
Jira Issue: DOC-1032
The text was updated successfully, but these errors were encountered: