title: How should I sanitize database input in Java?
body: <p>Could someone please point me to a good beginner guide on safely running SQL queries formed partly from user input?  I'm using Java, but a language neutral guide is fine too. </p>
  
  <p>The desired behaviour is that if someone types into the GUI something like </p>
  
  <p><code>very nice;) DROP TABLE FOO;</code></p>
  
  <p>The database should treat it as a literal string and store it safely without dropping any tables. </p>