Postgresql Data Source

Hello everyone;

I'm trying the db tools with postgresql from this wonderful PHPStorm, by I always get an Error by time out, because jdbc tries to connect to localhost.

I've tried to make a port redirect to localhost, by even doing that I get the very same error. I'm pretty sure the database url is ok: jdbc:postgresql://dev.fakeurl.com:5432/my_test_db

Did anyone here face the same problem?

Thank you all!!!

Jorge GOMES

3 comments
Comment actions Permalink

I do not face this problem and never did. What JDBC driver do you use and how do you now it goes to localhost?
The URL looks valid indeed. I hope dev.fakeurl.com pings OK and the DB instance is up and running on 5432 port.
Does any other DB client work (like pgAdmin, Squirrel SQL ...)?

0
Comment actions Permalink

Hello,

Thanks for your answer. In fact I use navicat and there's no problem the connection is done.

I'm using the postgresql-9.1-901.jdbc4.jar as driver, and org.postgresl.Driver as Driver Class.

And when I test the connection, the error pops up and tells:

java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
 java.net.ConnectException: Operation timed out
 at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
 at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
 at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
 at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
 at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
 in RemoteProcessSupport$2.compute(RemoteProcessSupport.java:221)
 in RemoteProcessSupport.a(RemoteProcessSupport.java:218)
Caused by: java.net.ConnectException: Operation timed out
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
 at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
 at java.net.Socket.connect(Socket.java:529)
 at java.net.Socket.connect(Socket.java:478)
 at java.net.Socket.<init>(Socket.java:375)
 at java.net.Socket.<init>(Socket.java:189)
 at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
 at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
 at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)

0
Comment actions Permalink

The error says RMI registry cannot be accessed. Please verify your firewall settings.
Database connection is really created in a separate process that communicates with the IDE via RMI.

RMI registry port is a random short number no less than 4000. You can look it up in the log file which should contain something like:

2012-09-14 19:41:43,872 [71867659]   INFO - ution.rmi.RemoteProcessSupport - Port/ID: 5667/RemoteDriverImpl9665567c


So in your case something prevents the IDE from accessing a process listening on localhost:5667 (in my example)

0

Please sign in to leave a comment.