Class PropertiesPasswordSource

java.lang.Object
org.attribyte.sql.pool.contrib.PropertiesPasswordSource
All Implemented Interfaces:
PasswordSource

public class PropertiesPasswordSource extends Object implements PasswordSource
A password source that uses Properties to resolve passwords.
  • [connection name]=[password]
  • [username]@[connection string]=[password]
  • Constructor Details

    • PropertiesPasswordSource

      public PropertiesPasswordSource(Properties properties)
      Creates a properties password source.
      Parameters:
      properties - The properties.
  • Method Details

    • getPassword

      public String getPassword(String connectionName)
      Description copied from interface: PasswordSource
      Gets the password for a named connection.
      Specified by:
      getPassword in interface PasswordSource
      Parameters:
      connectionName - The connection name.
      Returns:
      The password or null if none.
    • getPassword

      public String getPassword(String connectionString, String username)
      Description copied from interface: PasswordSource
      Gets the password for a connection string and username.
      Specified by:
      getPassword in interface PasswordSource
      Parameters:
      connectionString - The connection string.
      username - The username.
      Returns:
      The password or null if none.