public static String createUpdatePreparedStmt(String tableName, List<String> columnNames, List<String> conditionKeys) {
    StringBuilder sb = new StringBuilder();
    sb.append("update " + tableName + " set ");
    sb.append(columnNames.stream().map(col -> col + "=?").collect(Collectors.joining(",")));
    sb.append(" where " + conditionKeys.stream().map(cond -> cond + "=?").collect(Collectors.joining(" and ")));
    return sb.toString();
  }
Checks is the passed exception, or any of the root (cause) exceptions are an instance of {@link SQLException}.
Returns with the found {@link SQLException} or throws an {@link IllegalArgumentException} if no {@link SQLException}
found in the chain.
@param ex The exception to check
@return Returns with the {@link SQLException} found in the exception chain. 
@throws IllegalArgumentException Thrown if there is no {@link SQLException} in the exception chain
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnUtils.java