![[JDBC] DB Connection ERROR / No operations allowed after connection closed](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2F8Tq2v%2Fbtshp30iLCB%2FAAAAAAAAAAAAAAAAAAAAADMJgGQtKqeI3NE6ymPmbZRD-A5tJ8W4h-opxSW4arTa%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DPmHxoM2ye3Jxb2nsv5KUpVIbFu8%253D)
Tech/트러블슈팅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객체를 의심해봐야 할 것이다. 해결 처음에는 아래와 같이 해결하고자 했..