Reputation: 45
I try to connect with a database of Postgres postgresql-9.1-902.jdbc4 in Netbeans 7.0 and I get this error in Java :
jul 19, 2012 9:35:02 AM databasedesktop.DatabaseDesktopApp startup
Grave: null
org.postgresql.util.PSQLException: El intento de conexión falló.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:150)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:123)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:28)
at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:20)
at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:22)
at org.postgresql.Driver.makeConnection(Driver.java:391)
at org.postgresql.Driver.connect(Driver.java:265)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:221)
at databasedesktop.DatabaseDesktop.initDatabasePostgre(DatabaseDesktop.java:45)
at databasedesktop.DatabaseDesktop.<init>(DatabaseDesktop.java:56)
at databasedesktop.DatabaseDesktopApp.startup(DatabaseDesktopApp.java:22)
at org.jdesktop.application.Application$1.run(Application.java:171)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.net.SocketException: Can't connect to SOCKS proxy:No route to host: connect
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:427)
at java.net.Socket.connect(Socket.java:578)
at java.net.Socket.connect(Socket.java:527)
at java.net.Socket.<init>(Socket.java:424)
at java.net.Socket.<init>(Socket.java:207)
at org.postgresql.core.PGStream.<init>(PGStream.java:60)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:74)
... 28 more
Upvotes: 1
Views: 1602
Reputation: 324971
You appear to be trying to use a SOCKS
proxy that is not running or reachable.
Caused by: java.net.SocketException: Can't connect to SOCKS proxy:No route to host: connect
Make sure that the proxy is actually running, and that it can reach the PostgreSQL server. Try using psql
to connect to the PostgreSQL server via your SOCKS proxy to verify that works - assuming you intended to connect via the proxy.
Have you set the socksProxyHost
and socksProxyPort
system properties, perhaps via the java command line? See this Java documentation on proxies.
Are you specifying a proxy to your JDBC connection?
Upvotes: 2