String sql = StringUtilsExt.replaceArrayMerge(sqlInsertItemValue,
new String[] { "#tableName#", "#tablePrimaryValue#" }, new String[] { storedVO.getTableName(), "?" });
java.sql.Timestamp timestamp = new java.sql.Timestamp(date.toInstant().toEpochMilli());
- Object[] params = new Object[] { storedVO.getValue(), timestamp, storedVO.getValue() };
+ Object[] params = new Object[] { timestamp, storedVO.getValue(), storedVO.getValue() };
logger.debug("JDBC::doStoreItemValue sql={} timestamp={} value='{}'", sql, timestamp, storedVO.getValue());
Yank.execute(sql, params);
}
* @return
*/
public static final String replaceArrayMerge(String str, String separate, Object[] separators) {
+ String s = str;
for (int i = 0; i < separators.length; i++) {
- str = str.replaceFirst(separate, (String) separators[i]);
+ s = s.replaceFirst(separate, (String) separators[i]);
}
- return str;
+ return s;
}
/**
* @see #replaceArrayMerge(String str, String separate, Object[] separators)
*/
public static final String replaceArrayMerge(String str, String[] separate, String[] separators) {
+ String s = str;
for (int i = 0; i < separators.length; i++) {
- str = str.replaceFirst(separate[i], separators[i]);
+ s = s.replaceFirst(separate[i], separators[i]);
}
- return str;
+ return s;
}
/**