Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do I escape single quotes in SQL queries

Tilak NarendraMar 13 2009 — edited Mar 13 2009
Hi

I am using EclipseLink + EJB 3.0.
When single quote ( ' ) is entered as search criteria for JPA query, it throws exception.

As specified in the bolow link , its generic sql problem.
http://it.toolbox.com/wiki/index.php/How_do_I_escape_single_quotes_in_SQL_queries%3F

If single-quote is used to escape a single-quote, it might fail in mySQL (which use a backslash as the escape character).

Please suggest generic way to resolve this issue, so that it works across DBMS.

Thanks
Tilak
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2009
Added on Mar 13 2009
1 comment
2,115 views