It would help to see your code and the exception you're getting. My guess is you're not casting the Connection object you get back from DriverManager to a PGConnection, but that's a shot in the dark at this point.
pgsql-jdbc by date:
Соглашаюсь с условиями обработки персональных данных