title: Best practice to provide MySQL JDBC driver password
body: <p>I have <code>JSP</code> web application deployed in <code>Tomcat7</code> server that use <code>MySQL</code> as a database. In database connection I'm currently providing clear text username and password as below.</p>
  
  <pre><code>Connection conn = DriverManager.getConnection("jdbc:mysql://hostname:3306/schema", "user", "password");
  </code></pre>
  
  <p>As a security requirement I cannot use plain text passwords in my code and I cannot use configuration files to store information ether so everything has to be in a database somewhere.</p>
  
  <p><strong>Q1</strong> As for this issue can I provide a hashed input for password field in connection string.?</p>
  
  <p><strong>Q2</strong> If I can't use file based configuration method which would be the best way to store sensitive information.? </p>