Re: Unable to connect to 9.5 via JDBC driver 1207

From: Radoslav Petrov <rado(at)edno(dot)moe>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Unable to connect to 9.5 via JDBC driver 1207
Date: 2016-02-02 17:20:32
Message-ID: 56B0E560.6030107@edno.moe
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Rob,
try to uncomment the following in pg_hba.conf:

# IPv4 local connections:
# host all all 127.0.0.1/32 trust

To become:

# IPv4 local connections:
host all all 127.0.0.1/32 trust

You can check the documentation here:
http://www.postgresql.org/docs/devel/static/auth-pg-hba-conf.html

On 2.02.2016 19:08, rob stone wrote:
> Hello,
>
> I downloaded the 9.5 release as Debian packages and everything is
> working as intended except for obtaining a connection via the JDBC
> driver.
>
> I use ExecuteQuery a lot. Both it and a silly little Java class that I
> wrote to test connecting both return the same error.
>
> I downloaded the Java source and tried to figure out what is happening
> without any success.
>
>
>
>
> org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
> "127.0.0.1", user "timeman", database "timemanager", SSL off
> at
> org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(Connectio
> nFactoryImpl.java:427)
> at
> org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(Connect
> ionFactoryImpl.java:203)
> at
> org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.
> java:65)
> at
> org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:159)
> at org.postgresql.Driver.makeConnection(Driver.java:416)
> at org.postgresql.Driver.connect(Driver.java:283)
> at
> org.executequery.datasource.SimpleDataSource.getConnection(SimpleDataSo
> urce.java:102)
> at
> org.executequery.datasource.SimpleDataSource.getConnection(SimpleDataSo
> urce.java:83)
> at
> org.executequery.datasource.ConnectionPoolImpl.createConnection(Connect
> ionPoolImpl.java:254)
> at
> org.executequery.datasource.ConnectionPoolImpl.ensureCapacity(Connectio
> nPoolImpl.java:202)
> at
> org.executequery.datasource.ConnectionPoolImpl.setMinimumConnections(Co
> nnectionPoolImpl.java:421)
> at
> org.executequery.datasource.ConnectionManager.createDataSource(Connecti
> onManager.java:87)
> at
> org.executequery.databasemediators.spi.DefaultConnectionBuilder.createD
> ataSource(DefaultConnectionBuilder.java:122)
> at
> org.executequery.databasemediators.spi.DefaultConnectionBuilder.access$
> 000(DefaultConnectionBuilder.java:35)
> at
> org.executequery.databasemediators.spi.DefaultConnectionBuilder$1.const
> ruct(DefaultConnectionBuilder.java:100)
> at
> org.underworldlabs.swing.util.SwingWorker$2.run(SwingWorker.java:130)
> at java.lang.Thread.run(Thread.java:745)
>
>
> --------------------------------------
>
> my pg_hba.conf file
>
> # TYPE DATABASE USER ADDRESS METHOD
>
> # "local" is for Unix domain socket connections only
> local all all trust
> # IPv4 local connections:
> # host all all 127.0.0.1/32 trust
> # IPv6 local connections:
> # host all all ::1/128 trust
> # Allow replication connections from localhost, by a user with the
> # replication privilege.
> #local replication postgres trust
> #host replication postgres 127.0.0.1/32 trust
> #host replication postgres ::1/128 trust
>
>
>
> -----------------------------------
>
> I can run psql without any problems.
>
> postgres(at)roblaptop:/home/postgres/data95$ psql -d timemanager -U
> timeman -p 5434
> psql (9.5.0)
> Type "help" for help.
>
> timemanager=> select count(*) from error_messages;
> count
> -------
> 357
> (1 row)
>
> timemanager=>
>
>
>
> Please let me know if any further information is required.
>
>
> Thanks,
> Rob
>
>

--
Поздрави, | Best regards,
Радослав Петров | Radoslav Petrov

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Thomas Kellerer 2016-02-02 18:54:05 Re: Unable to connect to 9.5 via JDBC driver 1207
Previous Message rob stone 2016-02-02 17:08:24 Unable to connect to 9.5 via JDBC driver 1207