# Dremio JDBC connection

**URL:** <https://community.dremio.com/t/dremio-jdbc-connection/6578>\
**Category:** Dremio University\
**Created:** [November 11, 2020, 6:56am UTC](https://community.dremio.com/t/dremio-jdbc-connection/6578 "2020-11-11T06:56:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tahseen](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@tahseen](https://community.dremio.com/u/tahseen)\
**Post date:** [November 11, 2020, 6:56am UTC](https://community.dremio.com/t/dremio-jdbc-connection/6578/1 "2020-11-11T06:56:50Z")

</div>

Hi,

I am new to dremio, I have installed Dremio on Centos, I want to connect PostgresSql with Dremio, But facing error while connecting PostgresSql,

`could not connect to pg, check your jdbc connection information and credentials dremio`

 ![image](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/c/c215796381f6044076512026e6fd7ba42fc9824d.png)

Please Help,  
Tahseen

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [November 11, 2020, 7:44am UTC](https://community.dremio.com/t/dremio-jdbc-connection/6578/2 "2020-11-11T07:44:19Z")

</div>

@tahseen

Have we tried without the encrypt option?

I see you have localhost, is Postgres running on the same node as Dremio is running?

Are you able to connect to Postgres from command line using the same credentials? Send us the Dremio server.log

Thanks  
Bali

---

<div class="post-metadata">

**Author:** ![tahseen](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@tahseen](https://community.dremio.com/u/tahseen)\
**Post date:** [November 11, 2020, 8:18am UTC](https://community.dremio.com/t/dremio-jdbc-connection/6578/3 "2020-11-11T08:18:22Z")

</div>

Hi,

Yes my postgres is running on localhost:5432, I have alredy connected my postgres with other application it was getting connected, but while connecting to dremio its giving JDBC error.

Thanks,  
Tahseen

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [November 11, 2020, 8:19am UTC](https://community.dremio.com/t/dremio-jdbc-connection/6578/4 "2020-11-11T08:19:44Z")

</div>

@tahseen

Are you able to send us the server.log?

---

<div class="post-metadata">

**Author:** ![tahseen](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@tahseen](https://community.dremio.com/u/tahseen)\
**Post date:** [November 11, 2020, 8:37am UTC](https://community.dremio.com/t/dremio-jdbc-connection/6578/5 "2020-11-11T08:37:07Z")

</div>

Hi,

```
2020-11-11 05:32:04,865 [start-postgres] ERROR c.d.e.store.jdbc.JdbcStoragePlugin - Connection is not valid.
java.sql.SQLException: Cannot create PoolableConnectionFactory (FATAL: database "oes" does not exist)
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2327)
	at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2056)
	at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
	at com.dremio.exec.store.jdbc.CloseableDataSource$DatasourceWrapper.getConnection(CloseableDataSource.java:87)
	at com.dremio.exec.store.jdbc.JdbcStoragePlugin.getState(JdbcStoragePlugin.java:406)
	at com.dremio.exec.catalog.ManagedStoragePlugin.setLocals(ManagedStoragePlugin.java:827)
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$newStartSupplier$1(ManagedStoragePlugin.java:524)
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$nameSupplier$3(ManagedStoragePlugin.java:591)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: FATAL: database "oes" does not exist
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
	at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2665)
	at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:147)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:273)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
	at org.postgresql.Driver.makeConnection(Driver.java:465)
	at org.postgresql.Driver.connect(Driver.java:264)
	at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:260)
	at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2337)
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2323)
	... 11 common frames omitted
2020-11-11 05:32:04,870 [start-postgres] WARN c.d.e.catalog.ManagedStoragePlugin - Error starting new source: postgres
java.lang.Exception: Unavailable
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$newStartSupplier$1(ManagedStoragePlugin.java:529)
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$nameSupplier$3(ManagedStoragePlugin.java:591)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
2020-11-11 05:32:04,870 [start-postgres] INFO c.d.s.s.LocalSchedulerService - Cancelling task metadata-refresh-wakeup-postgres
2020-11-11 05:32:04,870 [qtp420561530-113] ERROR c.d.e.store.jdbc.JdbcStoragePlugin - JDBC source postgres has not been started.
2020-11-11 05:41:22,497 [start-postgres] ERROR c.d.e.store.jdbc.JdbcStoragePlugin - Connection is not valid.
java.sql.SQLException: Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "postgres")
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2327)
	at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2056)
	at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
	at com.dremio.exec.store.jdbc.CloseableDataSource$DatasourceWrapper.getConnection(CloseableDataSource.java:87)
	at com.dremio.exec.store.jdbc.JdbcStoragePlugin.getState(JdbcStoragePlugin.java:406)
	at com.dremio.exec.catalog.ManagedStoragePlugin.setLocals(ManagedStoragePlugin.java:827)
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$newStartSupplier$1(ManagedStoragePlugin.java:524)
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$nameSupplier$3(ManagedStoragePlugin.java:591)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
	at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:613)
	at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:161)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
	at org.postgresql.Driver.makeConnection(Driver.java:465)
	at org.postgresql.Driver.connect(Driver.java:264)
	at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:260)
	at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2337)
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2323)
	... 11 common frames omitted
2020-11-11 05:41:22,498 [start-postgres] WARN c.d.e.catalog.ManagedStoragePlugin - Error starting new source: postgres
java.lang.Exception: Unavailable
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$newStartSupplier$1(ManagedStoragePlugin.java:529)
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$nameSupplier$3(ManagedStoragePlugin.java:591)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
2020-11-11 05:41:22,499 [start-postgres] INFO c.d.s.s.LocalSchedulerService - Cancelling task metadata-refresh-wakeup-postgres
2020-11-11 05:41:22,499 [qtp420561530-114] ERROR c.d.e.store.jdbc.JdbcStoragePlugin - JDBC source postgres has not been started.
2020-11-11 05:41:34,380 [start-postgres] ERROR c.d.e.store.jdbc.JdbcStoragePlugin - Connection is not valid.
java.sql.SQLException: Cannot create PoolableConnectionFactory (FATAL: password authentication failed for user "postgres")
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2327)
	at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2056)
	at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
	at com.dremio.exec.store.jdbc.CloseableDataSource$DatasourceWrapper.getConnection(CloseableDataSource.java:87)
	at com.dremio.exec.store.jdbc.JdbcStoragePlugin.getState(JdbcStoragePlugin.java:406)
	at com.dremio.exec.catalog.ManagedStoragePlugin.setLocals(ManagedStoragePlugin.java:827)
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$newStartSupplier$1(ManagedStoragePlugin.java:524)
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$nameSupplier$3(ManagedStoragePlugin.java:591)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"
	at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:613)
	at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:161)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:225)
	at org.postgresql.Driver.makeConnection(Driver.java:465)
	at org.postgresql.Driver.connect(Driver.java:264)
	at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:260)
	at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2337)
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2323)
	... 11 common frames omitted
2020-11-11 05:41:34,381 [start-postgres] WARN c.d.e.catalog.ManagedStoragePlugin - Error starting new source: postgres
java.lang.Exception: Unavailable
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$newStartSupplier$1(ManagedStoragePlugin.java:529)
	at com.dremio.exec.catalog.ManagedStoragePlugin.lambda$nameSupplier$3(ManagedStoragePlugin.java:591)
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
2020-11-11 05:41:34,381 [start-postgres] INFO c.d.s.s.LocalSchedulerService - Cancelling task metadata-refresh-wakeup-postgres
2020-11-11 05:41:34,381 [qtp420561530-96] ERROR c.d.e.store.jdbc.JdbcStoragePlugin - JDBC source postgres has not been started.

```

Thanks,  
Tahseen

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [November 11, 2020, 8:39am UTC](https://community.dremio.com/t/dremio-jdbc-connection/6578/6 "2020-11-11T08:39:41Z")

</div>

@tahseen

I see the below error  
{code}  
Caused by: org.postgresql.util.PSQLException: FATAL: database “oes” does not exist  
{code}

Is this the right DB name?

---

<div class="post-metadata">

**Author:** ![tahseen](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@tahseen](https://community.dremio.com/u/tahseen)\
**Post date:** [November 11, 2020, 8:47am UTC](https://community.dremio.com/t/dremio-jdbc-connection/6578/7 "2020-11-11T08:47:24Z")

</div>

Hi,

I was makaing the mistake by putting the wrong database name.  
Now my dremio is successfully connected with PostgresSql.

Thanks,  
Tahseen

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [November 11, 2020, 8:53am UTC](https://community.dremio.com/t/dremio-jdbc-connection/6578/8 "2020-11-11T08:53:21Z")

</div>

@tahseen  
Thanks for the update, glad it works now
