Debug Log

JPA) Could not open JDBC Connection for transaction

밍미a 2023. 2. 2. 14:32
728x90

문제인식

jdbc 연습하느라 테스트코드 돌리는데 Could not open JDBC Connection for transaction 이런 에러가 났다.

 

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.

5432포트랑 커넥션 할수 없다고 포트나 IP 확인해 보라고 한다.


문제해결

처음엔 5432포트를 어디서 연결해줘야 하는지 생각이 안나서 헤맸는데

생각해보니까 도커를 안켜줘서 그런거였다.

도커 데스크탑에서 도커 열어주니까 잘 돌아갔다.