I need some function in Java like mysql_real_escape_string() or addslashes() in PHP. Are there any classes available that expose methods like those... An example where I need this is.. I get name from user: Name: o'reilly example query which would cause problem:
It's good to know that PreparedStatements automatically escape strings... The common package has functions I need but I never have used commons.lang package.
is this package already available with default JDK installation? do I have to install any other package to make these classes available? do I have to set classpath as well? how do I refer these classes in my programs...say Commmons.lang.StringEscapeUtils.escapeJava(String)