koul 2 лет назад
Родитель
Сommit
094fa88bb3
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      src/com/uas/fileUtil/FileUtil.java

+ 3 - 1
src/com/uas/fileUtil/FileUtil.java

@@ -212,9 +212,10 @@ public class FileUtil {
 		int size = (int) file.getSize();
 		if(size>0) {
 			Statement statement = null;
+			ResultSet set=null;
 			try {
 				statement = connection.createStatement();
-				ResultSet set = statement.executeQuery("select count(1) from " + sob + ".FTPATTCHTEMP where FT_FILENAME='" + filename + "' and FT_SOB='"+sob+"'");
+				set = statement.executeQuery("select count(1) from " + sob + ".FTPATTCHTEMP where FT_FILENAME='" + filename + "' and FT_SOB='"+sob+"'");
 				while (set.next()){
 					int count = set.getInt(1);
 					if (count==0){
@@ -248,6 +249,7 @@ public class FileUtil {
 				e.printStackTrace();
 			}finally {
 				try {
+					set.close();
 					statement.close();
 				} catch (SQLException e) {
 					throw new RuntimeException(e);