From f32b4c189595afd4aec7e6f991ac998a2b058c04 Mon Sep 17 00:00:00 2001
From: DELL <1525436766@qq.com>
Date: 星期五, 06 九月 2024 14:01:38 +0800
Subject: [PATCH] V6.108 edit by lijun 	@  2024-09-06 	1.修复通信线程,MSQL抛出异常导致线程异常结束bug

---
 iec61850_forFoShanAES_Model/src/com/dec/fbs9100/FBS9100_Task_Thread_SQL.java |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/iec61850_forFoShanAES_Model/src/com/dec/fbs9100/FBS9100_Task_Thread_SQL.java b/iec61850_forFoShanAES_Model/src/com/dec/fbs9100/FBS9100_Task_Thread_SQL.java
index 6c8d745..e6badf6 100644
--- a/iec61850_forFoShanAES_Model/src/com/dec/fbs9100/FBS9100_Task_Thread_SQL.java
+++ b/iec61850_forFoShanAES_Model/src/com/dec/fbs9100/FBS9100_Task_Thread_SQL.java
@@ -655,8 +655,9 @@
 	{
 		String sql_str = "SELECT * FROM " + Sql_Mysql.FBS9100SetParam_Table;
 		Sql_Mysql sql = new Sql_Mysql(con_pool);
-		ResultSet res = sql.sqlMysqlQuery(sql_str);
+		ResultSet res = null;
 		try {
+			res = sql.sqlMysqlQuery(sql_str);
 			while(res.next())
 			{
 				FBS9100_StatAndParam param = null;
@@ -688,7 +689,6 @@
 				}
 			}
 		} catch (SQLException e) {
-			// TODO Auto-generated catch block
 			sql.logger.error("FBS9100_Task_Thread_SQL.queryFbs9100SetParam():" + e.toString(), e);
 		} finally {
 			if(null != res) {
@@ -712,8 +712,9 @@
 	{
 		String sql_str = "SELECT * FROM " + Sql_Mysql.FBS9100SetParam_Table + " where dev_id = " + param.dev_id;
 		Sql_Mysql sql = new Sql_Mysql(con_pool);
-		ResultSet res = sql.sqlMysqlQuery(sql_str);
+		ResultSet res = null;
 		try {
+			res = sql.sqlMysqlQuery(sql_str);
 			if(res.next())
 			{
 				if(null != param) {
@@ -820,8 +821,9 @@
 		//System.out.println(param.dev_id);
 		String sql_str = "SELECT * FROM " + Sql_Mysql.FBS9100SetDLParam_Table + " where dev_id = " + param.dev_id;
 		Sql_Mysql sql = new Sql_Mysql(con_pool);
-		ResultSet res = sql.sqlMysqlQuery(sql_str);
+		ResultSet res = null;
 		try {
+			res = sql.sqlMysqlQuery(sql_str);
 			if(res.next())
 			{
 				if(null != param) {
@@ -1301,8 +1303,9 @@
 	public static void queryFBS9100SysParamBydev_id(MysqlConnPool con_pool, FBS9100_StatAndParam param) {
 		String sql_str = "SELECT * FROM " + Sql_Mysql.FBS9100SysParam_Table + " where dev_id = " + param.dev_id;
 		Sql_Mysql sql = new Sql_Mysql(con_pool);
-		ResultSet res = sql.sqlMysqlQuery(sql_str);
+		ResultSet res = null;
 		try {
+			res = sql.sqlMysqlQuery(sql_str);
 			if(res.next())
 			{
 				if(null != param) {
@@ -1525,9 +1528,10 @@
 	public static void queryBTS61850OffLineyhPlanOnRam(MysqlConnPool m_ConnPool, FBS9100_StatAndParam param) {
 		String sql_str = " SELECT * FROM " + Sql_Mysql.FBS9100_offlineyhplan + " WHERE dev_id = " + param.dev_id ;
 		Sql_Mysql sql = new Sql_Mysql(m_ConnPool);
-		ResultSet res = sql.sqlMysqlQuery(sql_str);
 		BTS61850_OffLineYHPlan plan = param.bts61850_OffLineYHPlan;
+		ResultSet res = null;
 		try {
+			res = sql.sqlMysqlQuery(sql_str);
 			if(res.next()) {
 				plan.OffLineYH_Cycle = res.getInt("OffLineYH_Cycle");
 				plan.OffLineYHOnceCycle = res.getInt("OffLineYHOnceCycle");
@@ -1730,8 +1734,10 @@
 	public static void queryDev6185AlmParamBydev_id(MysqlConnPool con_pool, FBS9100_StatAndParam param) {
 		String sql_str = "SELECT * FROM " + Sql_Mysql.Dev_6185_AlmParam + " where dev_id = " + param.dev_id;
 		Sql_Mysql sql = new Sql_Mysql(con_pool);
-		ResultSet res = sql.sqlMysqlQuery(sql_str);
+		ResultSet res = null;
+		
 		try {
+			res = sql.sqlMysqlQuery(sql_str);
 			if(res.next())
 			{
 				if(null != param) {

--
Gitblit v1.9.1