title: Java can't connect to MySQL if password contain % symbol
body: <p>Here is my connection URL:</p>
  
  <pre><code>jdbc:mysql://mydbhost:3306/mydatabase?user=username&amp;password=%u16*!ypK@WrUQbr
  </code></pre>
  
  <p>When i call </p>
  
  <pre><code>DriverManager.getConnection()
  </code></pre>
  
  <p>with current URL i'm catching exception:</p>
  
  <pre><code>ava.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "u1"
  </code></pre>
  
  <p>If connection URL not contain % everything works.</p>
  
  <p>i have found some info about this issue, and there recommend to do next conversion :</p>
  
  <pre><code>replaceAll("%(?![0-9a-fA-F]{2})", "%25")
  </code></pre>
  
  <p>With this conversion i have error:</p>
  
  <pre><code>Access denied for user(incorrect password)
  </code></pre>
  
  <p>Can somebody help to convert url correctly?</p>