Commit e174b93a authored by prane's avatar prane

added error trapping and prpoper exception handling

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@200935 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 788ad05f
...@@ -91,8 +91,11 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -91,8 +91,11 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
{ {
throw new Exception("Exception while calling confirm for tran Id:[" + tranID + "]"); throw new Exception("Exception while calling confirm for tran Id:[" + tranID + "]");
} }
} catch (Exception exception) { } catch (Exception e) {
System.out.println("Exception in [InvHoldConfEJB] getCurrdateAppFormat " + exception.getMessage()); //System.out.println("Exception in [InvHoldConfEJB] getCurrdateAppFormat " + exception.getMessage());
System.out.println("Exception :PriceListconf :confirm()::" + e.getMessage() + ":"); //Pavan Rane 20may19 [Exception handling to be proper]
e.printStackTrace();
throw new ITMException(e);
} }
return retString; return retString;
} }
...@@ -287,7 +290,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -287,7 +290,8 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
e1.printStackTrace(); e1.printStackTrace();
} }
} }
System.out.println("Exception : " + e); //System.out.println("Exception : " + e); //Pavan Rane 20may19 [Exception handling to be proper]
System.out.println("Exception :PriceListconf :confirm(String tranId, String xtraParams...::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} finally { } finally {
...@@ -332,7 +336,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -332,7 +336,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
private String insertPricelist(String tranId, HashMap PList, ArrayList PricelistGen, Connection conn, private String insertPricelist(String tranId, HashMap PList, ArrayList PricelistGen, Connection conn,
String xtraParams) throws RemoteException, ITMException String xtraParams) throws RemoteException, ITMException
{ {
PreparedStatement pstmtSql, pstmtInsert = null, pstmtInner = null; PreparedStatement pstmtSql = null, pstmtInsert = null, pstmtInner = null;
ResultSet rs = null, rsInner = null; ResultSet rs = null, rsInner = null;
String dbName = ""; String dbName = "";
String sql = ""; String sql = "";
...@@ -1417,11 +1421,38 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -1417,11 +1421,38 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
}//end for PricelistGen }//end for PricelistGen
// try end // try end
} catch (Exception e) { } catch (Exception e)
System.out.println(e.getMessage()); {
System.out.println("Exception : " + e); //Pavan Rane 20may19 [Exception handling to be proper and added finally]
System.out.println("Exception :PriceListconf : insertPricelist()::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
}finally {
try {
if(rs != null) {
rs.close();
rs = null;
}
if(rsInner != null) {
rsInner.close();
rsInner = null;
}
if(pstmtSql != null) {
pstmtSql.close();
pstmtSql = null;
}
if(pstmtInsert != null) {
pstmtInsert.close();
pstmtInsert = null;
}
if(pstmtInner != null) {
pstmtInner.close();
pstmtInner = null;
}
}catch(Exception ex)
{
}
} }
return retString; return retString;
} }
...@@ -1508,6 +1539,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -1508,6 +1539,7 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
} }
} catch (Exception e) } catch (Exception e)
{ {
e.printStackTrace();//Pavan Rane 20may19 [Exception handling to be proper]
retString = itmDBAccessLocal.getErrorString("", "VTLCKERR", "", "", conn); retString = itmDBAccessLocal.getErrorString("", "VTLCKERR", "", "", conn);
throw new ITMException(e); throw new ITMException(e);
} }
...@@ -1648,11 +1680,36 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca ...@@ -1648,11 +1680,36 @@ public class PriceListConf extends ActionHandlerEJB implements PriceListConfLoca
} }
} catch (Exception e) } catch (Exception e)
{ {
System.out.println(e.getMessage()); //System.out.println(e.getMessage()); //Pavan Rane 20may19 [Exception handling to be proper and added finally]
System.out.println("Exception : " + e); //System.out.println("Exception : " + e);
System.out.println("Exception :PriceListconf : insertPricelist()::" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
finally {
try {
if(rs != null) {
rs.close();
rs = null;
}
if(rsInner != null) {
rsInner.close();
rsInner = null;
}
if(pstmtSql != null) {
pstmtSql.close();
pstmtSql = null;
}
if(pstmtInner != null) {
pstmtInner.close();
pstmtInner = null;
}
}catch(Exception ex)
{
}
}
return retString; return retString;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment