首页 > 解决方案 > 打开一个无效的数据库连接

问题描述

我有一个必须在每天午夜执行的 java 函数,它就像一个数据库更新。

问题是我得到一个错误

Exception d'E/S: Connection reset by peer: socket write error; nested exception is java.sql.SQLException: Exception d'E/S: Connection reset by peer: socket write error

我正在使用 oracle 11g 数据库和休眠。有没有办法检查我的数据库连接是否无效我如何重新打开一个只是为了执行该功能并再次关闭它。随着时间的推移,它可能会导致服务器过载。

标签: javaoraclehibernateoracle11g

解决方案


推荐阅读