Commit 514f522a authored by vvengurlekar's avatar vvengurlekar

ReceivablesOpening.java, ReceivablesOpeningConf.java - added code to close connection


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@191883 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b3074f5b
...@@ -183,6 +183,26 @@ conn = getConnection(); ...@@ -183,6 +183,26 @@ conn = getConnection();
} }
catch(SQLException se) catch(SQLException se)
{ {
//added by Varsha V on 11-10-18 for closing connection
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.rollback();
}
catch(Exception e)
{
System.out.println("Exception --["+ e.getMessage()+"]");
}
//ended by Varsha V on 11-10-18 for closing connection
System.out.println("SQLException [04][confirmReceivables][Excuting Query Failed]" + sqlHdr + se.getMessage()); System.out.println("SQLException [04][confirmReceivables][Excuting Query Failed]" + sqlHdr + se.getMessage());
se.printStackTrace(); se.printStackTrace();
retString = se.getMessage(); retString = se.getMessage();
...@@ -190,6 +210,26 @@ conn = getConnection(); ...@@ -190,6 +210,26 @@ conn = getConnection();
} }
catch(Exception e) catch(Exception e)
{ {
//added by Varsha V on 11-10-18 for closing connection
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.rollback();
}
catch(Exception e1)
{
System.out.println("Exception --["+ e1.getMessage()+"]");
}
//ended by Varsha V on 11-10-18 for closing connection
System.out.println("Exception [05][confirmReceivables][Excuting Query Failed]" + sqlHdr + e.getMessage()); System.out.println("Exception [05][confirmReceivables][Excuting Query Failed]" + sqlHdr + e.getMessage());
e.printStackTrace(); e.printStackTrace();
retString = e.getMessage(); retString = e.getMessage();
...@@ -281,6 +321,26 @@ conn = getConnection(); ...@@ -281,6 +321,26 @@ conn = getConnection();
} }
catch(SQLException se) catch(SQLException se)
{ {
//added by Varsha V on 11-10-18 for closing connection
try
{
if(rsMst != null)
{
rsMst.close();
rsMst = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
conn.rollback();
}
catch(Exception e)
{
System.out.println("Exception --["+ e.getMessage()+"]");
}
//ended by Varsha V on 11-10-18 for closing connection
System.out.println("SQLException [07][confirmReceivables][Excuting Query Failed]" + sql + se.getMessage()); System.out.println("SQLException [07][confirmReceivables][Excuting Query Failed]" + sql + se.getMessage());
se.printStackTrace(); se.printStackTrace();
retString = se.getMessage(); retString = se.getMessage();
...@@ -288,6 +348,26 @@ conn = getConnection(); ...@@ -288,6 +348,26 @@ conn = getConnection();
} }
catch(Exception e) catch(Exception e)
{ {
//added by Varsha V on 11-10-18 for closing connection
try
{
if(rsMst != null)
{
rsMst.close();
rsMst = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
conn.rollback();
}
catch(Exception e1)
{
System.out.println("Exception --["+ e1.getMessage()+"]");
}
//ended by Varsha V on 11-10-18 for closing connection
System.out.println("Exception [08][confirmReceivables]" + e.getMessage()); System.out.println("Exception [08][confirmReceivables]" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
retString = e.getMessage(); retString = e.getMessage();
...@@ -464,6 +544,31 @@ conn = getConnection(); ...@@ -464,6 +544,31 @@ conn = getConnection();
} }
catch(Exception e) catch(Exception e)
{ {
//added by Varsha V on 11-10-18 for closing connection
try
{
if(rsMst != null)
{
rsMst.close();
rsMst = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.rollback();
}
catch(Exception e1)
{
System.out.println("Exception --["+ e1.getMessage()+"]");
}
//ended by Varsha V on 11-10-18 for closing connection
System.out.println("Exception [11][confirmReceivables][Excuting Query Failed]" + sqlIns + e.getMessage()); System.out.println("Exception [11][confirmReceivables][Excuting Query Failed]" + sqlIns + e.getMessage());
e.printStackTrace(); e.printStackTrace();
retString = e.getMessage(); retString = e.getMessage();
...@@ -558,6 +663,13 @@ conn = getConnection(); ...@@ -558,6 +663,13 @@ conn = getConnection();
System.out.println("SQLException [13][confirmReceivables][Excuting Query Fail]" + sql+ se.getMessage()); System.out.println("SQLException [13][confirmReceivables][Excuting Query Fail]" + sql+ se.getMessage());
try try
{ {
//added by Varsha V on 11-10-18 for closing connection
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//ended by Varsha V on 11-10-18 for closing connection
conn.rollback(); conn.rollback();
} }
catch(Exception e) catch(Exception e)
...@@ -574,6 +686,13 @@ conn = getConnection(); ...@@ -574,6 +686,13 @@ conn = getConnection();
e.printStackTrace(); e.printStackTrace();
try try
{ {
//added by Varsha V on 11-10-18 for closing connection
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//ended by Varsha V on 11-10-18 for closing connection
conn.rollback(); conn.rollback();
} }
catch(Exception e1) catch(Exception e1)
...@@ -581,6 +700,7 @@ conn = getConnection(); ...@@ -581,6 +700,7 @@ conn = getConnection();
e = e1; e = e1;
} }
retString = e.getMessage(); retString = e.getMessage();
return retString;
} }
finally finally
{ {
...@@ -726,16 +846,31 @@ conn = getConnection(); ...@@ -726,16 +846,31 @@ conn = getConnection();
System.out.println("SQLException[16] :[ReceivablesOpeningConfEJB][Excuting Query Failed]" + sql + se.getMessage()); System.out.println("SQLException[16] :[ReceivablesOpeningConfEJB][Excuting Query Failed]" + sql + se.getMessage());
se.printStackTrace(); se.printStackTrace();
conn.rollback();//Added by Jiten 27/07/06 conn.rollback();//Added by Jiten 27/07/06
//added by Varsha V on 11-10-18 for closing connection
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//ended by Varsha V on 11-10-18 for closing connection
retString = se.getMessage(); retString = se.getMessage();
return retString; return retString;
} }
catch(Exception e) catch(Exception e)
{ {
retString = "Not Confirmed"; retString = "Not Confirmed";
conn.rollback();//Added by Jiten 27/07/06 conn.rollback();//Added by Jiten 27/07/06
//added by Varsha V on 11-10-18 for closing connection
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
//ended by Varsha V on 11-10-18 for closing connection
System.out.println("Exception[17] ::"+e.getMessage()); System.out.println("Exception[17] ::"+e.getMessage());
e.printStackTrace(); e.printStackTrace();
retString = "Not Confirmed :" + e.getMessage(); retString = "Not Confirmed :" + e.getMessage();
return retString;
} }
finally finally
{ {
......
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