Open ericharmeling opened 3 years ago
See https://github.com/cockroachdb/docs/pull/9998 for where this thought came from:
with vanilla JDBC you need to do
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