I have a seemingly elementary problem, but I can't seem to come up with a simple solution. Look at the following line of code:
s.execute("insert into Requests values ('"+field5.getText().trim()+"','"+tempTime+"','"+tempTime+": PROBLEM OPENED\n\n"+tempTime+": "+area.getText()+"','','Open');");
I am using this to add a record to my SQL table. However, whenever there is an apostrophe (') read from the area.getText(), that causes the SQL statement to be improperly executed. I understand why it's causing a problem, but I was wondering if there was a simple solution for it. Or is my only recourse to have my application check every single character in the JTextArea area for apostrophes and insert backslashes before the SQL statement is executed? Thanks for the help!