title: Wildfly: Encrypt password and username for database
body: <p>I would like to hand over a webapplication to some people but these people should not allowed to has access to the database with some tools. Using the webapplicaton and in the background the database is ok.</p>
  
  <p>Wildfly has a config with these code:</p>
  
  <pre><code>&lt;xa-datasource jndi-name="java:jboss/datasources/ExampleXADS" pool-name="ExampleXADS"&gt;
         &lt;driver&gt;h2&lt;/driver&gt;
         &lt;xa-datasource-property name="URL"&gt;jdbc:h2:mem:test&lt;/xa-datasource-property&gt;
         &lt;xa-pool&gt;
              &lt;min-pool-size&gt;10&lt;/min-pool-size&gt;
              &lt;max-pool-size&gt;20&lt;/max-pool-size&gt;
              &lt;prefill&gt;true&lt;/prefill&gt;
         &lt;/xa-pool&gt;
         &lt;security&gt;
              &lt;user-name&gt;sa&lt;/user-name&gt;
              &lt;password&gt;sa&lt;/password&gt;
         &lt;/security&gt;
      &lt;/xa-datasource&gt;
  </code></pre>
  
  <p>As you can see, there is also the username and password available. How is it possible to exclude / encrypt these, so only the administrator know the password for the database. 
  The same also for the whole application server - there are also users and password.
  How can I do this?</p>
  
  <p>EDIT:
  The "customer" will get the whole application inclusive the webserver configuration. (Wilfly and .war - file)
  It´s only for saving the software key in the database. 
  The first time if the "customer" start the web application, he will be prompted so enter the licence key. 
  After entering the license key a Webservice will be called. The return code is "false" or "true" (is key valid or is key not valid) 
  My first idea was to store the flag in the database. But if a user has access to the database, he can manipulate this flag on his own.
  Is there any other possibility to set a flag for "the software key is valid" instead saving the flag in the database.
  Any ideas?</p>