Is it possible to encrypt the password for connecting to the database that is inside a Java application?

1

I'm using a Java application and using the PostgreSQL database. To make the connection to the bank I use this method:

    public static Connection getConnection() throws Exception {
        try {
            Class.forName("org.postgresql.Driver");
            Connection connection = DriverManager.getConnection(Constantes.URL_BD, Constantes.USUARIO_BD, Constantes.SENHA_BD);

            return connection;

        } catch (Exception e) {
            throw new Exception(e.getMessage());
        }
    }

I would like to know if by passing the password to the getConnection () method of DriverManager it may be encrypted in some way ... either using md5 or another type of hash.

    
asked by anonymous 08.11.2017 / 18:47

0 answers