I'll assume that you're using a Statement (from a Connection.createStatement() invocation).
Try this modified code out for size.
Before too long of fussing around with funny looking
string concatenation and character escaping and single-quote matching, you'll probably want to discover the use of a PreparedStatement. Try a quick search on this forum for example uses of a PreparedStatement.
[ April 27, 2003: Message edited by: Dirk Schreckmann ]