*BF [ 1874419 ] JDBC Statement not close in a finally block
organize imports
This commit is contained in:
parent
6bf804d6df
commit
6f3f7ddfb6
|
@ -16,11 +16,21 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.process;
|
package org.compiere.process;
|
||||||
|
|
||||||
import java.net.*;
|
import java.net.URL;
|
||||||
import java.sql.*;
|
import java.sql.ResultSet;
|
||||||
import java.util.logging.*;
|
import java.sql.Statement;
|
||||||
import org.compiere.model.*;
|
import java.sql.Timestamp;
|
||||||
import org.compiere.util.*;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.compiere.model.MAsset;
|
||||||
|
import org.compiere.model.MAssetDelivery;
|
||||||
|
import org.compiere.model.MClient;
|
||||||
|
import org.compiere.model.MMailText;
|
||||||
|
import org.compiere.model.MProductDownload;
|
||||||
|
import org.compiere.model.MUser;
|
||||||
|
import org.compiere.model.MUserMail;
|
||||||
|
import org.compiere.util.DB;
|
||||||
|
import org.compiere.util.EMail;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deliver Assets Electronically
|
* Deliver Assets Electronically
|
||||||
|
@ -128,10 +138,11 @@ public class AssetDelivery extends SvrProcess
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int errors = 0;
|
int errors = 0;
|
||||||
int reminders = 0;
|
int reminders = 0;
|
||||||
|
ResultSet rs = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
stmt = DB.createStatement();
|
stmt = DB.createStatement();
|
||||||
ResultSet rs = stmt.executeQuery(s);
|
rs = stmt.executeQuery(s);
|
||||||
while (rs.next())
|
while (rs.next())
|
||||||
{
|
{
|
||||||
int A_Asset_ID = rs.getInt(1);
|
int A_Asset_ID = rs.getInt(1);
|
||||||
|
@ -156,25 +167,17 @@ public class AssetDelivery extends SvrProcess
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rs.close();
|
}
|
||||||
stmt.close();
|
|
||||||
stmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, s, e);
|
log.log(Level.SEVERE, s, e);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
try
|
DB.close(rs, stmt);
|
||||||
{
|
rs = null; stmt = null;
|
||||||
if (stmt != null)
|
|
||||||
stmt.close ();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{}
|
|
||||||
stmt = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("Count=" + count + ", Errors=" + errors + ", Reminder=" + reminders
|
log.info("Count=" + count + ", Errors=" + errors + ", Reminder=" + reminders
|
||||||
+ " - " + (System.currentTimeMillis()-start) + "ms");
|
+ " - " + (System.currentTimeMillis()-start) + "ms");
|
||||||
return "@Sent@=" + count + " - @Errors@=" + errors;
|
return "@Sent@=" + count + " - @Errors@=" + errors;
|
||||||
|
|
Loading…
Reference in New Issue