mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
!213 bugfix #I7WNDA close方法遵循先打开的后关闭原则
Merge pull request !213 from 与或非/issues/I7WNDA
This commit is contained in:
@@ -91,10 +91,10 @@ public class LiteFlowJdbcUtil {
|
|||||||
* @param rs rs
|
* @param rs rs
|
||||||
*/
|
*/
|
||||||
public static void close(Connection conn, PreparedStatement stmt, ResultSet rs) {
|
public static void close(Connection conn, PreparedStatement stmt, ResultSet rs) {
|
||||||
// 关闭连接
|
// 关闭结果集
|
||||||
if (conn != null) {
|
if (rs != null) {
|
||||||
try {
|
try {
|
||||||
conn.close();
|
rs.close();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new ELSQLException(e.getMessage());
|
throw new ELSQLException(e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -107,10 +107,10 @@ public class LiteFlowJdbcUtil {
|
|||||||
throw new ELSQLException(e.getMessage());
|
throw new ELSQLException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 关闭结果集
|
// 关闭连接
|
||||||
if (rs != null) {
|
if (conn != null) {
|
||||||
try {
|
try {
|
||||||
rs.close();
|
conn.close();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new ELSQLException(e.getMessage());
|
throw new ELSQLException(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user