If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Dealing with SQL special characters with Java

I am writing a program to convert the information read from a url into an "INSERT" statement so as that I can use this information on my own page. The problem is that I am saving some of the HTML tags i.e. <table>, as Strings. So for example....

I then want to insert this string into a field in a database however, the quotation marks (") prevent the string from being read as a whole string! SQL interprets them as operators and doesnt know what to do. I know that Perl has a function to deal with this - I think its the escape function - but i was wondering is there a way similar to do it in java without having to go through each quotation mark and deal with them seperately as i have a lot of code.

Thanks, but I thought of doing that already. The thing is that with all the <," and = characters it becomes very messy. Was just hoping someone would know of a way to feed the string into a function like an escape() function that would do it automatically. There is one in Perl so i thought there might be one in Java.