diff --git a/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java b/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java index 272bcc65..9628ca74 100644 --- a/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java +++ b/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java @@ -136,6 +136,22 @@ public class JDBCUtil 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 * routine provides a common workaround which is to represent a UTF-8