定义一个全局变量static ResultSet rs1 = null;
然后,
while ( rs.next()) {
       int ID=rs.getInt("ID");
        byteArray=rs.getBytes("File_Bit");
        senderID = rs.getString("SendID");
        recipientID = rs.getString("ReceiveID");
        targetType = rs.getString("MobileType");        
        smil = readfile(smilName);
        gif = byteArray;
        doUpload();
        strSQL = "update [File] set Is_Send=0 where ID="+ID+"";
        System.out.println(strSQL);
        stmt1.executeUpdate(strSQL);
        System.out.println("OK!!");
      }    
               if(rs.equals(rs1)){
                try {
        Thread.sleep(5000);
    }
    catch (InterruptedException ex) {
    }
               }
      rs.close();
不知道行不行,试试吧!