diff --git a/src/java/org/apache/commons/lang/StringEscapeUtils.java b/src/java/org/apache/commons/lang/StringEscapeUtils.java index 148cd0166..92d613f67 100644 --- a/src/java/org/apache/commons/lang/StringEscapeUtils.java +++ b/src/java/org/apache/commons/lang/StringEscapeUtils.java @@ -665,32 +665,6 @@ public class StringEscapeUtils { return Entities.XML.unescape(str); } - //----------------------------------------------------------------------- - /** - *
Escapes the characters in a String
to be suitable to pass to
- * an SQL query.
For example, - *
statement.executeQuery("SELECT * FROM MOVIES WHERE TITLE='" + - * StringEscapeUtils.escapeSql("McHale's Navy") + - * "'");- * - * - *
At present, this method only turns single-quotes into doubled single-quotes
- * ("McHale's Navy"
=> "McHale''s Navy"
). It does not
- * handle the cases of percent (%) or underscore (_) for use in LIKE clauses.
null
if null string input
- */
- public static String escapeSql(String str) {
- if (str == null) {
- return null;
- }
- return StringUtils.replace(str, "'", "''");
- }
-
//-----------------------------------------------------------------------
/**
diff --git a/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java b/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
index 18e6233f4..8562a32e6 100644
--- a/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
+++ b/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
@@ -324,17 +324,6 @@ public class StringEscapeUtilsTest extends TestCase {
assertEquals("XML was unescaped incorrectly", "