class StringUtils {

  public static String sanitizeDbUri(String uri)
  {
    String result = uri;
    Matcher m = ORA_JDBC_URI_PATTERN.matcher(uri);
    if (m.matches())
    {
      result = m.group(1) + "*/*" + m.group(4);
    }
    else if (uri.startsWith("jdbc:mysql:"))
    {
      Matcher m1 = MYSQL_JDBC_PATTERN1.matcher(result);
      Matcher m2 = MYSQL_JDBC_PATTERN2.matcher(result);
      if (m1.find())
      {
        result = m1.replaceAll("($1*)");
      }
      else if (m2.find())
      {
        result = m2.replaceAll("$1*");
      }
    }

    return result;
  }

}