mirror of
https://github.com/dataease/dataease.git
synced 2026-06-17 04:51:43 +08:00
fix: 处理连接池为空的情况
This commit is contained in:
@@ -35,7 +35,9 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
} catch (Exception e) {
|
||||
throw new Exception("ERROR:" + e.getMessage(), e);
|
||||
} finally {
|
||||
connection.close();
|
||||
if(connection != null){
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -52,7 +54,9 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
} catch (Exception e) {
|
||||
throw new Exception("ERROR:" + e.getMessage(), e);
|
||||
} finally {
|
||||
connection.close();
|
||||
if(connection != null){
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +74,9 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
} catch (Exception e) {
|
||||
throw new Exception("ERROR:" + e.getMessage(), e);
|
||||
} finally {
|
||||
connection.close();
|
||||
if(connection != null){
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +116,9 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
} catch (Exception e) {
|
||||
throw new Exception("ERROR:" + e.getMessage(), e);
|
||||
} finally {
|
||||
connection.close();
|
||||
if(connection != null){
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +143,9 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
} catch (Exception e) {
|
||||
throw new Exception("ERROR:" + e.getMessage(), e);
|
||||
} finally {
|
||||
connection.close();
|
||||
if(connection != null){
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +185,9 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
} catch (Exception e) {
|
||||
throw new Exception("ERROR: " + e.getMessage(), e);
|
||||
} finally {
|
||||
con.close();
|
||||
if(con != null){
|
||||
con.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,7 +226,9 @@ public class JdbcProvider extends DatasourceProvider {
|
||||
} catch (Exception e) {
|
||||
throw new Exception("ERROR:" + e.getMessage(), e);
|
||||
} finally {
|
||||
connection.close();
|
||||
if(connection != null){
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user