Getting "Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections" when connecting via jdbc
Hi, I am using JDBC to connect to a Postgres DB. I am calling a method that connects to the DB twice. It connects once to do a select statement and another time to do an insert statement. I am checking to see if the a session_id exists and if it doesn't I am adding the session_id into the DB. It does the initial select fine, but when I try to connect the second time to do the insert I am getting the error in the title above. Here is what my code looks like. Can anyone help me out with resolving this?
Thanks!