*BF [ 1874419 ] JDBC Statement not close in a finally block

organize imports
This commit is contained in:
Redhuan D. Oon 2008-02-19 10:39:08 +00:00
parent 2e6f00dc7e
commit aa5981ad8f
1 changed files with 17 additions and 17 deletions

View File

@ -16,11 +16,17 @@
*****************************************************************************/
package org.compiere.process;
import java.math.*;
import java.sql.*;
import java.util.logging.*;
import org.compiere.model.*;
import org.compiere.util.*;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.logging.Level;
import org.compiere.model.MClient;
import org.compiere.model.MColumn;
import org.compiere.model.MTable;
import org.compiere.util.AdempiereUserError;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
/**
@ -63,33 +69,27 @@ public class TranslationDocSync extends SvrProcess
+ "WHERE TableName LIKE '%_Trl' AND TableName NOT LIKE 'AD%' "
+ "ORDER BY TableName";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = DB.prepareStatement (sql, get_TrxName());
ResultSet rs = pstmt.executeQuery ();
rs = pstmt.executeQuery ();
while (rs.next ())
{
processTable (new MTable(getCtx(), rs, null), client.getAD_Client_ID());
}
rs.close ();
pstmt.close ();
pstmt = null;
}
catch (Exception e)
{
log.log (Level.SEVERE, sql, e);
}
try
finally
{
if (pstmt != null)
pstmt.close ();
pstmt = null;
}
catch (Exception e)
{
pstmt = null;
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
return "OK";
} // doIt