Commit 4dcecdb4 authored by cpandey's avatar cpandey

changes prepare statement instead of statement


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92559 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1a1b01af
......@@ -226,6 +226,7 @@ public class LCDetPos extends ValidatorEJB implements LCDetPosLocal, LCDetPosRem
Node currDetail = null;
Statement stmt = null;
ResultSet rs = null;
PreparedStatement pstmt = null;
int updCnt = 0;
GenericUtility genericUtility = GenericUtility.getInstance();
......@@ -242,17 +243,24 @@ public class LCDetPos extends ValidatorEJB implements LCDetPosLocal, LCDetPosRem
lineNoSord = genericUtility.getColumnValueFromNode("line_no__sord",currDetail);
descr = genericUtility.getColumnValueFromNode("descr",currDetail);
System.out.println("saleOrder :: "+saleOrder);
System.out.println("lineNoSord ::"+lineNoSord);
System.out.println("descr ::"+descr);
System.out.println("saleOrder -->>:: "+saleOrder);
System.out.println("lineNoSord -->>::"+lineNoSord);
System.out.println("descr-->> ::"+descr);
lineNoSord = " " + lineNoSord;
lineNoSord = lineNoSord.substring(lineNoSord.length()-3);
System.out.println("lineNoSord ::"+lineNoSord);
sqlUpd = "UPDATE SORDDET SET ITEM_DESCR = '"+descr+"' WHERE SALE_ORDER = '"+saleOrder+"' AND LINE_NO = '"+lineNoSord+"'";
stmt = conn.createStatement();
updCnt = stmt.executeUpdate(sqlUpd);
// sqlUpd = "UPDATE SORDDET SET ITEM_DESCR = '"+descr+"' WHERE SALE_ORDER = '"+saleOrder+"' AND LINE_NO = '"+lineNoSord+"'";
//changes done by cpandey on 24/01/13
sqlUpd = "update sorddet set item_descr = ? where sale_order = ? and line_no = ?";
System.out.println("PREPARE STATEMENT --->>");
pstmt = conn.prepareStatement(sqlUpd);
pstmt.setString(1,descr);
pstmt.setString(2,saleOrder);
pstmt.setString(3,lineNoSord);
updCnt = pstmt.executeUpdate();
System.out.println("updCnt-->>["+updCnt+"]");
//end of changes done by cpandey on 24/01/13
if (updCnt > 0)
{
System.out.println("Update Into SORDDET Successfully....:: " + updCnt);
......@@ -295,10 +303,10 @@ public class LCDetPos extends ValidatorEJB implements LCDetPosLocal, LCDetPosRem
{
try
{
if(stmt != null)
if(pstmt != null)
{
stmt.close();
stmt = null;
pstmt.close();
pstmt = null;
}
}
catch(Exception e)
......
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