1

I'm trying to connect to PostgreSQL from NetBeans, but it is showing some errors:

Cannot establish a connection to jdbc:postgresql://localhost:5432/postgres using org.postgresql.Driver (The authentication type 10 is not supported. Check that you have configured the pg_hba.conf file to include the client's IP address or subnet, and that it is using an authentication scheme supported by the driver.)

I tried changing password in config file and also tried change the md5. How to resolve it and connect PostgreSQL using Java?

enter image description here

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • 1
    Make sure you have the latest version of the JDBC driver. – Andreas Jan 13 '21 at 04:51
  • @Andreas How to check that? – user3855492 Jan 13 '21 at 05:34
  • 1
    You are using an outdated JDBC driver. [Download](https://jdbc.postgresql.org/download.html) and install the current one that supports scram authentication. See e.g. [here](https://stackoverflow.com/a/64211633/) –  Jan 13 '21 at 06:41
  • 1
    Normally, the JDBC driver jar file name has the version number. Current latest version is **42.2.18**, so the file name is `postgresql-42.2.18.jar` for Java 8+ version. – Andreas Jan 13 '21 at 07:28

0 Answers0