Commit 341a3b2b authored by smestry's avatar smestry

W15LKAT004, Changed the servlet for product creation edit.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101335 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 418e8399
...@@ -53,11 +53,11 @@ public class ProdWizItemChangeServlet extends HttpServlet ...@@ -53,11 +53,11 @@ public class ProdWizItemChangeServlet extends HttpServlet
ServletOutputStream outputStream = null; ServletOutputStream outputStream = null;
HttpSession sess = null; HttpSession sess = null;
String sql = ""; String sql = "", sqlSel = "";
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null, pstmtSel = null;
ResultSet rs = null; ResultSet rs = null, rsSel = null;
try try
{ {
...@@ -69,6 +69,12 @@ public class ProdWizItemChangeServlet extends HttpServlet ...@@ -69,6 +69,12 @@ public class ProdWizItemChangeServlet extends HttpServlet
System.out.println("ACTION = ["+action+"]"); System.out.println("ACTION = ["+action+"]");
//Added by Prasad on 08/06/15 [for multiple action] END //Added by Prasad on 08/06/15 [for multiple action] END
// Changed by Sneha on 07-04-2016, for item description [Start]
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
String itemCode = request.getParameter("ITEMCODE");
// Changed by Sneha on 07-04-2016, for item description [End]
/*sess = request.getSession(); /*sess = request.getSession();
System.out.println( "sess.getId() :["+sess.getId()+"]" ); System.out.println( "sess.getId() :["+sess.getId()+"]" );
...@@ -91,7 +97,49 @@ public class ProdWizItemChangeServlet extends HttpServlet ...@@ -91,7 +97,49 @@ public class ProdWizItemChangeServlet extends HttpServlet
{ {
retStr = genericUtility.getApplDateFormat(); retStr = genericUtility.getApplDateFormat();
} }
System.out.println("retStr = ["+retStr+"]"); // Changed by Sneha on 07-04-2016, for item description [Start]
else if(action.equalsIgnoreCase( "GET_ITEM_DESCR" ))
{
System.out.println("itemCode inside GET_ITEM_DESCR ---------->>" + itemCode);
sql = " SELECT ITEM_PARNT FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
sqlSel = " SELECT ATTR_VALUE FROM OBJ_ATTRIBUTE WHERE ITEM_ATTR_VAL = 'ITEM_CODE:"+checkNullAndTrim(rs.getString("ITEM_PARNT"))+"' AND LANGUAGES = 'EN' ";
pstmtSel = conn.prepareStatement(sqlSel);
rsSel = pstmtSel.executeQuery();
if (rsSel.next())
{
retStr = checkNullAndTrim(rsSel.getString("ATTR_VALUE"));
}
if (rsSel != null)
{
rsSel.close();
rsSel = null;
}
if (pstmtSel != null )
{
pstmtSel.close();
pstmtSel = null;
}
}
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null )
{
pstmt.close();
pstmt = null;
}
}
// Changed by Sneha on 07-04-2016, for item description [End]
System.out.println("retStr ====>> ["+retStr+"]");
//changed by Prasad on 08/06/15 [for multiple action] START //changed by Prasad on 08/06/15 [for multiple action] START
response.setContentType("text/xml"); response.setContentType("text/xml");
...@@ -113,7 +161,7 @@ public class ProdWizItemChangeServlet extends HttpServlet ...@@ -113,7 +161,7 @@ public class ProdWizItemChangeServlet extends HttpServlet
outStream.close(); outStream.close();
} }
System.out.println("****** ProdWizItemChangeServlet call end successfully ***********"); System.out.println("****** ProdWizItemChangeServlet call end successfully ***********");
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -130,6 +178,49 @@ public class ProdWizItemChangeServlet extends HttpServlet ...@@ -130,6 +178,49 @@ public class ProdWizItemChangeServlet extends HttpServlet
} }
} }
// Changed by Sneha on 07-04-2016 [Start]
finally
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null )
{
pstmt.close();
pstmt = null;
}
if (rsSel != null)
{
rsSel.close();
rsSel = null;
}
if (pstmtSel != null )
{
pstmtSel.close();
pstmtSel = null;
}
if (conn != null && !conn.isClosed())
{
conn.close();
conn = null;
}
}
// Changed by Sneha on 07-04-2016 [End]
catch (Exception e)
{
System.out.println("Exception :ProdWizItemChangeServlet :==>\n"+ e.getMessage());
try {
throw new ITMException(e);
} catch (ITMException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
} }
protected InitialContext getInitialContext()throws ITMException protected InitialContext getInitialContext()throws ITMException
......
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