By using PreparedStatement, I have no problem with insert and update. But when I am doing select, preparedstatement doesn't take care of '\'' for me. For example, I have a sql statement. String sqlStatement = " select * from mytable where text = 'Elenor's home'"; I am wondering besides replacing the '\'' with "''", is there any other ways to do it? Any idea will be helpful! Thanks in advance!
Originally posted by Renee Zhang: By using PreparedStatement, I have no problem with insert and update. But when I am doing select, preparedstatement doesn't take care of '\'' for me. For example, I have a sql statement. String sqlStatement = " select * from mytable where text = 'Elenor's home'"; I am wondering besides replacing the '\'' with "''", is there any other ways to do it? Any idea will be helpful! Thanks in advance!
PreparedStatement only works if you use the setXXX() methods. eg. --> this works:
Jamie
Renee Zhang
Ranch Hand
Joined: Sep 10, 2001
Posts: 72
posted
0
Thanks a lot! Jamie! I really apreciate your help!
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.