wangwei 5 年之前
父節點
當前提交
e116477ad9
共有 1 個文件被更改,包括 0 次插入12 次删除
  1. 0 12
      src/main/java/cn/com/qmth/examcloud/commons/util/DBUtil.java

+ 0 - 12
src/main/java/cn/com/qmth/examcloud/commons/util/DBUtil.java

@@ -136,18 +136,6 @@ public class DBUtil {
 			throw new RuntimeException(e);
 		}
 
-		final DataSource finalDataSource = dataSource;
-		Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
-			public void run() {
-				try {
-					DataSources.destroy(finalDataSource);
-				} catch (SQLException e) {
-					LOG.error("[JDBC] Fail to destroy dataSource. dataSourceName=" + dataSourceName,
-							e);
-				}
-			}
-		}));
-
 		Connection conn = null;
 		try {
 			conn = dataSource.getConnection();