728x90
728x90
[JDBC] DB Connection ERROR / No operations allowed after connection closed
트러블슈팅2023. 5. 25. 16:33[JDBC] DB Connection ERROR / No operations allowed after connection closed

에러 메세지 No operations allowed after connection closed 에러 원인 PreparedStatement pst = mysql.prepareStatement(query); 위의 코드에서 에러가 발생했는데, 에러 원인은 Connection 객체가 연결 해제됐거나. PreparedStatement 이 이상하거나 둘 중 하나라고 생각했는데, connection closed이기 때문에 Connection의 인스턴스인 mysql이 연결 해제된 후에 pst를 사용하여 쿼리를 실행하려 했기 때문인 것 같다. 만약 No operations allowed after statement closed 이라면 statement객체를 의심해봐야 할 것이다. 해결 처음에는 아래와 같이 해결하고자 했..

728x90
728x90
image