Commit 2e3e3226 authored by prane's avatar prane

statement changed to prepared statement and closed and null set to cursor and pstmt

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@197659 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1be15a73
......@@ -667,6 +667,10 @@ public class PostOrdDespatchGen
if(qtyAllocStd==0)
{
// System.out.println(">>The selected transaction is confirmed");
rs2.close();//23feb19[to close the cursor and pstmt while returning string]
rs2 = null;
pstmt2.close();
pstmt2 = null;
errString = itmDBAccessEJB.getErrorString("","VTDESP6","","",conn);
return errString;
}
......@@ -686,6 +690,10 @@ public class PostOrdDespatchGen
{
// errcode = "Unable to convert quantity";
// System.out.println("Unable to convert quantity");
rs2.close();//23feb19[to close the cursor and pstmt while returning string]
rs2 = null;
pstmt2.close();
pstmt2 = null;
errString = itmDBAccessEJB.getErrorString("","VTQTY01","","",conn);
return errString;
}
......@@ -699,6 +707,10 @@ public class PostOrdDespatchGen
{
//errcode = "Unable to convert quantity";
// System.out.println("Unable to convert quantity");
rs2.close();//23feb19[to close the cursor and pstmt while returning string]
rs2 = null;
pstmt2.close();
pstmt2 = null;
errString = itmDBAccessEJB.getErrorString("","VTQTY01","","",conn);
return errString;
}
......@@ -956,6 +968,10 @@ public class PostOrdDespatchGen
{
// errcode = 'VTRATE1'
//System.out.println(">Rate is not proper for "+ itemCode + "@" + lotNo);
rs2.close();//23feb19[to close the cursor and pstmt while returning string]
rs2 = null;
pstmt2.close();
pstmt2 = null;
errString = itmDBAccessEJB.getErrorString("","VTRATE1","","",conn);
return errString;
}
......@@ -1019,6 +1035,10 @@ public class PostOrdDespatchGen
if(mrate<0)
{
// System.out.println(">Rate is not proper for !!! "+ itemCode + "@" + lotNo);
rs2.close();//23feb19[to close the cursor and pstmt while returning string]
rs2 = null;
pstmt2.close();
pstmt2 = null;
errString = itmDBAccessEJB.getErrorString("","VTRATE1","","",conn);
return errString;
}
......@@ -1988,7 +2008,8 @@ public class PostOrdDespatchGen
private static String generateTranId(String windowName, String userId, Connection conn) throws Exception
{
Statement stmt = null;
//Statement stmt = null;//23feb19[stmt to pstmt changed]
PreparedStatement pstmt;
ResultSet rs = null;
String sql = "";
String tranId = "";
......@@ -1996,9 +2017,12 @@ public class PostOrdDespatchGen
CommonConstants commonConstants = new CommonConstants();
try
{
sql = "SELECT KEY_STRING, TRAN_ID_COL, nvl(REF_SER,'PEXRE') FROM TRANSETUP WHERE TRAN_WINDOW = '"+windowName+"'";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
//sql = "SELECT KEY_STRING, TRAN_ID_COL, nvl(REF_SER,'PEXRE') FROM TRANSETUP WHERE TRAN_WINDOW = '"+windowName+"'";
sql = "SELECT KEY_STRING, TRAN_ID_COL, nvl(REF_SER,'PEXRE') FROM TRANSETUP WHERE TRAN_WINDOW = ? ";
//stmt = conn.createStatement();
pstmt = conn.prepareStatement();
pstmt.setString(1, windowName)
rs = pstmt.executeQuery();
// System.out.println("keyString :"+rs.toString());
String keyString = "";
String keyCol = "";
......@@ -2009,6 +2033,10 @@ public class PostOrdDespatchGen
keyCol = rs.getString(2);
tranSer = rs.getString(3);
}
rs.close();//23feb19[to close the cursor and pstmt while retuing string]
rs = null;
pstmt.close();
pstmt = null;
String xmlValues = "";
//System.out.println("keyCol"+keyCol);
//System.out.println("keyString"+keyString);
......@@ -2538,4 +2566,4 @@ public class PostOrdDespatchGen
}
return tranId;
}//generateTranTd()
}
}
\ No newline at end of file
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