boolean passwordCorrect = false;
try {
Logger logger = new Logger();
Properties info = new Properties();
info.setProperty("password", password);
ConnectionFactory connectionFactory = new ConnectionFactoryImpl();
ProtocolConnection connection = connectionFactory.openConnectionImpl(
host, port, getDataSource().getUser(), "template1", info, logger);
connection.close();
passwordCorrect = true;
} catch (SQLException e) {
// expected for wrong password