title: How to connect to a database that requires password without exposing the password?
body: <p>I am creating an application and I need to connect to a database. The database requires login/password so the application can do operations like select and insert.</p>
  
  <p>In the application I need to connect to the database using login and password, so the application is free to do some tasks on the database. <strong>My question is: how do I store and use a password to connect to the database without exposing the password?</strong> </p>
  
  <p>I can't simply use a hash or encryption to store the password because the database must recognize the password (I think most or all databases must receive password as plain text). </p>
  
  <p>.</p>
  
  <p>.</p>
  
  <p>Note: The connection is made by the application. No human input to do the connection.</p>
  
  <p>(Edit)More info about the application: it is a web application using servlets/jsp. The database is on the same server of the application. The user for the application is a default user without complete admin powers, but it may insert/delete rows and do most things that involve queries and data modification in tables.</p>