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.
The desired behaviour is that if someone types into the GUI something like
very nice;) DROP TABLE FOO;
The database should treat it as a literal string and store it safely without dropping any tables.