diff --git a/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java b/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java index c83bd75d..9310d9ff 100644 --- a/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java +++ b/projects/samskivert/src/java/com/samskivert/jdbc/JDBCUtil.java @@ -25,6 +25,7 @@ import java.sql.*; import com.samskivert.Log; import com.samskivert.io.PersistenceException; +import com.samskivert.util.StringUtil; /** * A repository for JDBC related utility functions. @@ -165,6 +166,15 @@ public class JDBCUtil } } + /** + * Utility method to jigger the specified string so that it's safe + * to use in a regular Statement. + */ + public static String safeJigger (String text) + { + return StringUtil.replace(jigger(text), "'", "\\'"); + } + /** * Returns true if the table with the specified name exists, false if * it does not. Note: the table name is case sensitive.