Commit c4b4cf1c authored by pborate's avatar pborate

Updated changes for connection close

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@198125 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ff5986c0
...@@ -28,6 +28,9 @@ public class SprsCustInfo extends ValidatorEJB ...@@ -28,6 +28,9 @@ public class SprsCustInfo extends ValidatorEJB
{ {
JSONObject customerInfoObj = new JSONObject(); JSONObject customerInfoObj = new JSONObject();
JSONObject finalCustomerInfoJson = new JSONObject(); JSONObject finalCustomerInfoJson = new JSONObject();
PreparedStatement pStmt = null;
ResultSet rs = null;
Connection conn = null;
try try
{ {
System.out.println("INSIDE SprsCustInfo ::::::::::::::: getCusotmerData ["+xmlData+"]" + getUserInfo()); System.out.println("INSIDE SprsCustInfo ::::::::::::::: getCusotmerData ["+xmlData+"]" + getUserInfo());
...@@ -47,10 +50,7 @@ public class SprsCustInfo extends ValidatorEJB ...@@ -47,10 +50,7 @@ public class SprsCustInfo extends ValidatorEJB
String empCode= userInfo.getEmpCode(); String empCode= userInfo.getEmpCode();
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
PreparedStatement pStmt = null;
ResultSet rs = null;
System.out.println("getCusotmerData tranDb:::: "+tranDb+" empCode "+empCode); System.out.println("getCusotmerData tranDb:::: "+tranDb+" empCode "+empCode);
Connection conn = null;
StringBuffer sqlCurrYear = new StringBuffer(); StringBuffer sqlCurrYear = new StringBuffer();
...@@ -106,6 +106,10 @@ public class SprsCustInfo extends ValidatorEJB ...@@ -106,6 +106,10 @@ public class SprsCustInfo extends ValidatorEJB
} }
System.out.println("count ::::: "+count); System.out.println("count ::::: "+count);
finalCustomerInfoJson.put("status", "Success" ); finalCustomerInfoJson.put("status", "Success" );
pStmt.close();
pStmt = null;
rs.close();
rs = null;
} }
} }
else else
...@@ -125,6 +129,32 @@ public class SprsCustInfo extends ValidatorEJB ...@@ -125,6 +129,32 @@ public class SprsCustInfo extends ValidatorEJB
} }
} }
finally
{
try
{
if( pStmt != null )
{
pStmt.close();
pStmt = null;
}
if ( rs != null )
{
rs.close();
rs = null;
}
if ( conn != null )
{
conn.close();
conn = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
System.out.println("customerInfoObj final:::::: "+finalCustomerInfoJson); System.out.println("customerInfoObj final:::::: "+finalCustomerInfoJson);
return finalCustomerInfoJson.toString(); return finalCustomerInfoJson.toString();
} }
......
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