From ab290efb7df666e173fcd88c32f066f333825c5e Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期六, 18 十月 2025 08:50:01 +0800
Subject: [PATCH] 联调
---
src/main/java/com/zy/common/service/erp/ErpSqlServer.java | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/zy/common/service/erp/ErpSqlServer.java b/src/main/java/com/zy/common/service/erp/ErpSqlServer.java
index 3469eec..ccc6207 100644
--- a/src/main/java/com/zy/common/service/erp/ErpSqlServer.java
+++ b/src/main/java/com/zy/common/service/erp/ErpSqlServer.java
@@ -245,31 +245,42 @@
private List<Map<String, Object>> executeQuery(String sql) {
Connection conn = null;
+ PreparedStatement pstm = null;
+ ResultSet rs = null;
try {
conn = getConn();
pstm = conn.prepareStatement(sql);
-
pstm.setQueryTimeout(QUERY_TIMEOUT_SECONDS);
-
rs = pstm.executeQuery();
-// List<Map<String, Object>> maps = convertList(rs);
+
+ // 鉁� 鍏堟妸 rs 杞崲瀹屽啀鍏抽棴杩炴帴
return convertList(rs);
+
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
- release();
- if (conn != null) {
- try {
+ // 鉂椾笉鑳芥彁鍓嶈皟鐢� release()锛屾敼涓烘墜鍔ㄩ噴鏀惧悇瀵硅薄
+ try {
+ if (rs != null) {
+ rs.close();
+ rs = null;
+ }
+ if (pstm != null) {
+ pstm.close();
+ pstm = null;
+ }
+ if (conn != null) {
conn.close();
conn = null;
- } catch (SQLException e) {
- e.printStackTrace();
}
+ } catch (SQLException e) {
+ e.printStackTrace();
}
}
}
+
public Number executeQueryCount(String sql, String column) {
Number value = 0;
Connection conn = null;
--
Gitblit v1.9.1