mawolski Posted October 15, 2015 Posted October 15, 2015 Hi Everyone!I have a problem with postgres jdbc data adapter in TIBCO Jaspersoft Studio. I'm trying to make a simple report from postgres database. When I tried to configure Postgres JDBC DATA ADAPTER, during connection test this error occured:net.sf.jasperreports.engine.JRException: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.at net.sf.jasperreports.data.jdbc.JdbcDataAdapterService.contributeParameters(JdbcDataAdapterService.java:130)at net.sf.jasperreports.data.AbstractDataAdapterService.test(AbstractDataAdapterService.java:128)at com.jaspersoft.studio.data.wizard.AbstractDataAdapterWizard$3.runOperations(AbstractDataAdapterWizard.java:162)at com.jaspersoft.studio.utils.jobs.CheckedRunnableWithProgress$1.run(CheckedRunnableWithProgress.java:59)at java.lang.Thread.run(Thread.java:745)Caused by: org.postgresql.util.PSQLException: Connection to localhost:5432 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:247)at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:156)at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:35)at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:47)at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:30)at org.postgresql.Driver.makeConnection(Driver.java:414)at org.postgresql.Driver.connect(Driver.java:282)at net.sf.jasperreports.data.jdbc.JdbcDataAdapterService.getConnection(JdbcDataAdapterService.java:168)at net.sf.jasperreports.data.jdbc.JdbcDataAdapterService.contributeParameters(JdbcDataAdapterService.java:128)... 4 moreCaused by: java.net.ConnectException: Connection refusedat java.net.PlainSocketImpl.socketConnect(Native Method)at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)at java.net.Socket.connect(Socket.java:579)at org.postgresql.core.PGStream.<init>(PGStream.java:61)at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:129)... 14 more I'm 100% sure that postmaster is running, and is configured corectly( allowed TCP/IP connections and so on) I'm also sure, that url link, database name, user name and password are correct. I'm using stadalone version of Jaspersoft Studio, postgres 9.3 and MacOS X El Capitan.I'll be gratefull for any answers.
hozawa Posted October 16, 2015 Posted October 16, 2015 Did you try connecting to Postgresql using pgadmin using the same information?
mawolski Posted October 16, 2015 Author Posted October 16, 2015 Thank you very much for an ansewer.Yes. I'm able to connect from any postgres client (PGadmin, psql, Valentina Studio etc.) . I'm using this database in my web application written in JAVA and I have no problems with JDBC connection .
mawolski Posted October 16, 2015 Author Posted October 16, 2015 Problem solved :) I replaced localhost with 127.0.0.1 in url link and that helped.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now