Sfoglia il codice sorgente

CDSS获取HIS信息JDBC连接过多

liuqq 3 anni fa
parent
commit
88840aff33

+ 15 - 3
src/main/java/com/diagbot/util/TZDBConn.java

@@ -132,7 +132,9 @@ public class TZDBConn {
             }
         } catch (Exception e) {
             e.printStackTrace();
-        }
+        }finally {
+			close();
+		}
 
         return drugs;
     }
@@ -156,7 +158,9 @@ public class TZDBConn {
             }
         } catch (Exception e) {
             e.printStackTrace();
-        }
+        }finally {
+			close();
+		}
 
         return diags;
     }
@@ -193,6 +197,8 @@ public class TZDBConn {
 			}
 		} catch (Exception e) {
 			e.printStackTrace();
+		}finally {
+			close();
 		}
 		return list;
 	}
@@ -218,6 +224,8 @@ public class TZDBConn {
 			}
 		} catch (Exception e) {
 			e.printStackTrace();
+		}finally {
+			close();
 		}
 		return pacs;
 	}
@@ -242,7 +250,9 @@ public class TZDBConn {
             }
         } catch (Exception e) {
             e.printStackTrace();
-        }
+        }finally {
+			close();
+		}
 
         return items;
     }
@@ -378,6 +388,8 @@ public class TZDBConn {
 			System.out.println(map);
 		} catch (Exception e) {
 			e.printStackTrace();
+		}finally {
+			close();
 		}
 		return map;
 	}

+ 15 - 3
src/main/java/com/diagbot/util/TZDBConn1.java

@@ -130,7 +130,9 @@ public class TZDBConn1 {
             }
         } catch (Exception e) {
             e.printStackTrace();
-        }
+        }finally {
+			close();
+		}
 
         return drugs;
     }
@@ -153,7 +155,9 @@ public class TZDBConn1 {
             }
         } catch (Exception e) {
             e.printStackTrace();
-        }
+        }finally {
+			close();
+		}
 
         return diags;
     }
@@ -185,6 +189,8 @@ public class TZDBConn1 {
 			}
 		} catch (Exception e) {
 			e.printStackTrace();
+		}finally {
+			close();
 		}
 		return list;
 	}
@@ -209,6 +215,8 @@ public class TZDBConn1 {
 			}
 		} catch (Exception e) {
 			e.printStackTrace();
+		}finally {
+			close();
 		}
 		return pacs;
 	}
@@ -232,7 +240,9 @@ public class TZDBConn1 {
             }
         } catch (Exception e) {
             e.printStackTrace();
-        }
+        }finally {
+			close();
+		}
 
         return items;
     }
@@ -377,6 +387,8 @@ public class TZDBConn1 {
 			}
 		} catch (Exception e) {
 			e.printStackTrace();
+		}finally {
+			close();
 		}
 		return map;
 	}