java - 打开一个无效的数据库连接
问题描述
我有一个必须在每天午夜执行的 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 数据库和休眠。有没有办法检查我的数据库连接是否无效我如何重新打开一个只是为了执行该功能并再次关闭它。随着时间的推移,它可能会导致服务器过载。
解决方案
推荐阅读
- javascript - 未捕获的语法错误:无法在模块外使用 import 语句
- matplotlib - matplotlib 中的图例,包含来自不同数据集的条目
- node.js - 无法将 Uint8 ArrayBuffer(图像)转换为 base64 缓冲区以保存在 Mongo 数据库中
- c - 首次使用 CS50 IDE 解决问题集 2 时的错误消息 - 可读性
- python - Python + Selenium:send_keys 将空格而不是数字发送到文本框
- javascript - 如何从子组件中的对象中获取数据并将其传递给 React 中的父组件中的方法
- spring-boot - Spring boot actuator/http.server.requests 端点不起作用
- awk - 使用符号正确匹配 awk 中的列?
- mysql - 需要帮助从表中删除重复的列
- javascript - 在计算中使用输入字段的值,并将结果显示在另一个元素中