Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- connection timeout when connecting to a remote postgresql database
- int i = 0;
- while(true){
- IConnection conn = ((ConnectionHelper)HelperFactory.getInstance().getHelper("ConnectionHelper")).getConnection("psql");
- if(conn != null && conn.connect()){
- conn.close();
- System.out.println(i++);
- }
- }
- DriverManager.getConnection("jdbc:postgresql://" + host + ":5432/" + database,
- user, password);
- 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:136)
- at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
- at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
- at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
- at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
- at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:30)
- at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
- at org.postgresql.Driver.makeConnection(Driver.java:393)
- at org.postgresql.Driver.connect(Driver.java:267)
Add Comment
Please, Sign In to add comment