in reply to Re^3: regexp question
in thread regexp question

I think I know that now, thanks to Anonymous Monk. I will be using "prepared statements" in Java to load the SQL. As I understand it, then one does not have to encode text for insertion.

Aren't I on the right track then Ikegami?

I thought this link might be helpful for others:   Prepared SQL statements in Java

Replies are listed 'Best First'.
Re^5: regexp question
by ikegami (Patriarch) on Jan 29, 2011 at 19:43 UTC
    Yes, but it's not "prepared" part that's important here, it's the placeholders ("?"). See the do above, for example.
      Understood.

        I want to thank Perl Monks for the advice given in this thread. Until now, I was completely unaware of "Prepared Statements" in Java (and "placeholders" in Perl), and now I have a little advice to give others:

        For any developer that has text from any source that will be stored in a relational database (and this includes fields such as 'name' and 'address'), use placeholders to enter the data. This removes any concern whatsoever with respect to unicode and characters that may cause havoc (e.g., single quotes, ampersands, and the like).

        Because this isn't my first experience with such disruptive characters, I do know trying to cover all the possibilities is maddening and time consuming, and really for no reason in the case of RDBMS.

        So thanks again to Ikegami and Anonymous Monk.