pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Radoslav Petrov <rado@edno.moe>
To: pgsql-jdbc@postgresql.org
Subject: Re: Unable to connect to 9.5 via JDBC driver 1207
Date: Tue, 2 Feb 2016 19:20:32 +0200
Message-ID: <56B0E560.6030107@edno.moe> (raw)
In-Reply-To: <1454432904.2165.6.camel@gmail.com>
References: <1454432904.2165.6.camel@gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@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

view thread (15+ messages)  latest in thread

Message-ID: <56B0E560.6030107@edno.moe>
Permalink:  ../56B0E560.6030107@edno.moe/
Also on:    postgresql.org/message-id/56B0E560.6030107@edno.moe

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: rado@edno.moe
  Subject: Re: Unable to connect to 9.5 via JDBC driver 1207
  In-Reply-To: <56B0E560.6030107@edno.moe>
  References: <1454432904.2165.6.camel@gmail.com> <56B0E560.6030107@edno.moe>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox