git-svn-id: https://samskivert.googlecode.com/svn/trunk@1680 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -136,6 +136,22 @@ public class JDBCUtil
|
|||||||
return "'" + StringUtil.replace(text, "'", "\\'") + "'";
|
return "'" + StringUtil.replace(text, "'", "\\'") + "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Escapes a list of values, separating the escaped values by
|
||||||
|
* commas. See {@link #escape(String)}.
|
||||||
|
*/
|
||||||
|
public static String escape (Object[] values)
|
||||||
|
{
|
||||||
|
StringBuffer buf = new StringBuffer();
|
||||||
|
for (int ii = 0; ii < values.length; ii++) {
|
||||||
|
if (ii > 0) {
|
||||||
|
buf.append(", ");
|
||||||
|
}
|
||||||
|
buf.append(escape(String.valueOf(values[ii])));
|
||||||
|
}
|
||||||
|
return buf.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Many databases simply fail to handle Unicode text properly and this
|
* Many databases simply fail to handle Unicode text properly and this
|
||||||
* routine provides a common workaround which is to represent a UTF-8
|
* routine provides a common workaround which is to represent a UTF-8
|
||||||
|
|||||||
Reference in New Issue
Block a user