简体   繁体   English

无法通过eclipse连接到在bluemix中创建的“针对PostgreSQL的数据库”数据库

[英]Unable to connect to “Compose for PostgreSQL” DB created in bluemix through eclipse

I am not able to establish connection to Compose for PostgreSQL DB service using eclipse. 我无法使用eclipse与PostgreSQL数据库服务Compose建立连接。 Getting below error while Testing the connection. 测试连接时遇到错误。

org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. 
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:122) 
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65) 
    at org.postgresql.jdbc2.AbstractJdbc2Connection.(AbstractJdbc2Connection.java:116) 
    at org.postgresql.jdbc3.AbstractJdbc3Connection.(AbstractJdbc3Connection.java:30) 
    at org.postgresql.jdbc3.Jdbc3Connection.(Jdbc3Connection.java:24) 
    at org.postgresql.Driver.makeConnection(Driver.java:369) 
    at org.postgresql.Driver.connect(Driver.java:245) 
    at org.eclipse.datatools.enablement.internal.postgresql.PostgreSQLJDBCConnection.createConnection(PostgreSQLJDBCConnection.java:87) 
    at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:105) 
    at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:54) 
    at org.eclipse.datatools.enablement.internal.postgresql.PostgreSQLJDBCConnection.(PostgreSQLJDBCConnection.java:47) 
    at org.eclipse.datatools.enablement.internal.postgresql.PostgreSQLConnectionFactory.createConnection(PostgreSQLConnectionFactory.java:51) 
    at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83) 
    at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:359) 
    at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76) 
    at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59) 
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) 
Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) 
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)

I am able to connect to the DB through the application deployed in BlueMix. 我能够通过BlueMix中部署的应用程序连接到数据库。

How are you populating the connection credentials? 您如何填充连接凭据? The application will have access the VCAP_SERVICES when run on Bluemix, but unless you have specifically copied that environment variable to your Eclipse environment, that information will not be available to your application. 当在Bluemix上运行时,该应用程序将有权访问VCAP_SERVICES,但是除非您已将该环境变量专门复制到Eclipse环境,否则该信息将对您的应用程序不可用。

The error indicates that the connection was refused. 该错误表明连接被拒绝。 This most likely means that the host and port combination you've entered is incorrect. 这很可能意味着您输入的主机和端口组合不正确。 You'll want to ensure that you can connect to the host. 您需要确保可以连接到主机。

You can check that your local system can connect by doing nc -vz xxxxx.dblayer.com 10000 where xxxxx.dblayer.com is the full hostname provided to you within the variable and 10000 is the port, also provided. 您可以通过执行nc -vz xxxxx.dblayer.com 10000来检查本地系统是否可以连接,其中xxxxx.dblayer.com是变量中提供给您的完整主机名,端口10000是也提供的端口。

It seems as though your syntax/configuration may not be correct as a connection being refused would indicate that it cannot connect however it's not clear from your post what hostname/port it's actually trying to connect to. 似乎您的语法/配置可能不正确,因为被拒绝的连接将表明它无法连接,但是从您的帖子中尚不清楚它实际上试图连接的主机名/端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在Bluemix Compose上为Postgresql使用Postgis - Unable to use Postgis on Bluemix Compose for Postgresql 无法使用PHP连接到Postgresql DB - Unable to connect to Postgresql DB with PHP 无法在 python 中连接到远程 Postgresql 数据库 - Unable to connect to a remote Postgresql db in python 无法连接到 Ubuntu 18.04 服务器上的 PostgreSQL db - Unable to connect to PostgreSQL db on Ubuntu 18.04 Server 通过 docker-compose 连接 Spring Cloud DataFlow 和 Postgresql-db - connect Spring Cloud DataFlow and Postgresql-db by docker-compose 无法通过KETTLE-Pentaho连接到PostgreSQL - Unable to connect to PostgreSQL through KETTLE-Pentaho 无法使用spring roo,eclipse,gwt和hibernate连接到postgresql数据库 - Unable to connect to a postgresql database with spring roo, eclipse, gwt, and hibernate 无法连接到我在Azure中新创建的Postgresql服务器 - Unable to connect to my newly created postgresql server in Azure 无法通过Linux上的节点连接到Postgresql DB - Can't Connect to Postgresql DB Through Node on Linux 无法通过 Google Cloud 上端口 8085 上的 pgadmin 远程连接到 postgresql - Unable to connect to postgresql remotely through pgadmin on port 8085 on Google Cloud
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM