Browse Source

【系统BUG】【结果集处理异常问题】

koul 4 years ago
parent
commit
b7a4e34eac

+ 1 - 1
src/main/java/com/uas/service/Impl/SendHttpImpl.java

@@ -99,7 +99,7 @@ public class SendHttpImpl implements SendHttp {
                                 name = name + cd_varchar50_4 + "_" + formatdate + substring + ";";
                             }
                         }
-                        /*result.close();*/
+                        result.close();
                     }
                     if (map.get("cd_varchar50_2") != null) {
                         params.add(new BasicNameValuePair("screenCustomerNo", map.get("cd_varchar50_2")));

+ 4 - 3
src/main/java/com/uas/service/Impl/UploadAttachImpl.java

@@ -122,10 +122,10 @@ public class UploadAttachImpl implements UploadAttach {
     }
     private void uploadAttachFtp(Statement statement,String sob,String attach,FTPClient client,String ip,
                                  String folder,String attachName,String dateString,String cd_id) throws SQLException {
-        ResultSet results = statement.executeQuery("select fp_path from " + sob + ".filepath where " +
+        ResultSet res = statement.executeQuery("select fp_path from " + sob + ".filepath where " +
                 "fp_id in (" + attach + ")");
-        while (results.next()) {
-            String path = results.getString("fp_path");
+        while (res.next()) {
+            String path = res.getString("fp_path");
             String substring = path.substring(path.lastIndexOf("."));
             File file = new File(path);
             if (client != null) {
@@ -136,6 +136,7 @@ public class UploadAttachImpl implements UploadAttach {
                 }
             }
         }
+        res.close();
     }
 
     private boolean upload(FTPClient client,String ip,String folder,File file,String name){