cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Postgress JDBC Error SQL Exception: [SQL State:] 08001

0 Likes
5,540

I am using Crystal reports and trying to create a JDBC connection. I am getting the following error:

Logon failed. Details: SQL Exception: [SQL State:] 08001 [Error Message:] Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

I was able to successfully do so with the CData driver, but I want to use an open source one. I am using the same information as I did with the CData software. I put the postgresql-42.3.1.jar in the SAP folder and updated the CRConfig.xml file with the new path and name. I also deleted the CData folder from my computer and reinstalled Crystal.

Connection URL: jdbc:postgresql:User=*****;Password=*****;Database=*****;Port=5432 (This is what I was using with the Cdata driver)

Databas Class Name: org.postgresql.Driver

Database: Same as with the Cdata driver.

UserID: ****

Password: ****

I would appreciate any help. Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Likes

If you look at the documentation for the PostgreSQL jdbc driver here, it appears that it's looking for a somewhat different format for the jdbc connection.

-Dell

DellSC
Active Contributor
0 Likes

It seems that the driver is looking for the URL in one of these formats:

//host:port/database
//host:port/

So, you would use "host:port" format instead of "host;Port=5432"

-Dell

Thank you so, so much! I got it to work.

I used the following format based on your suggestion.

jdbc:postgresql://<server name>:[port number]/<database name>

Which for me looks like:

jdbc:postgresql://mylongserverurl.com:5432/accounting

Thanks again!

Answers (0)