Would you believe, yet another convenience method?

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1655 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2005-06-08 23:20:15 +00:00
parent 1cab976a7d
commit f79e82002c
@@ -127,6 +127,15 @@ public class JDBCUtil
}
}
/**
* Escapes any single quotes in the supplied text and wraps it in
* single quotes to make it safe for embedding into a database query.
*/
public static String escape (String text)
{
return "'" + StringUtil.replace(text, "'", "\\'") + ",";
}
/**
* Many databases simply fail to handle Unicode text properly and this
* routine provides a common workaround which is to represent a UTF-8