diff --git a/edu.harvard.i2b2.server-common/src/core/edu/harvard/i2b2/common/util/db/JDBCUtil.java b/edu.harvard.i2b2.server-common/src/core/edu/harvard/i2b2/common/util/db/JDBCUtil.java index 084eda24..945fb3fb 100755 --- a/edu.harvard.i2b2.server-common/src/core/edu/harvard/i2b2/common/util/db/JDBCUtil.java +++ b/edu.harvard.i2b2.server-common/src/core/edu/harvard/i2b2/common/util/db/JDBCUtil.java @@ -69,7 +69,12 @@ public static String getClobStringWithLinebreak(Clob clob) throws SQLException, */ public static String escapeSingleQuote(String x) { - return escapeSingleQuote(x, false); + return escapeSingleQuote(x, false) + // In some cases it still got unescaped single quote. + // e.g. during node drag and drop operation when the node name contains a single quote. + // Therefore, we handle it explicitly to make sure there is no unescaped single quote. + .replace("'", "''") // replace all, regardless. + .replace("''''", "''"); // change back for those that were escaped twice. }