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 ...@@ -667,6 +667,10 @@ public class PostOrdDespatchGen
if(qtyAllocStd==0) if(qtyAllocStd==0)
{ {
// System.out.println(">>The selected transaction is confirmed"); // 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); errString = itmDBAccessEJB.getErrorString("","VTDESP6","","",conn);
return errString; return errString;
} }
...@@ -686,6 +690,10 @@ public class PostOrdDespatchGen ...@@ -686,6 +690,10 @@ public class PostOrdDespatchGen
{ {
// errcode = "Unable to convert quantity"; // errcode = "Unable to convert quantity";
// System.out.println("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); errString = itmDBAccessEJB.getErrorString("","VTQTY01","","",conn);
return errString; return errString;
} }
...@@ -699,6 +707,10 @@ public class PostOrdDespatchGen ...@@ -699,6 +707,10 @@ public class PostOrdDespatchGen
{ {
//errcode = "Unable to convert quantity"; //errcode = "Unable to convert quantity";
// System.out.println("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); errString = itmDBAccessEJB.getErrorString("","VTQTY01","","",conn);
return errString; return errString;
} }
...@@ -956,6 +968,10 @@ public class PostOrdDespatchGen ...@@ -956,6 +968,10 @@ public class PostOrdDespatchGen
{ {
// errcode = 'VTRATE1' // errcode = 'VTRATE1'
//System.out.println(">Rate is not proper for "+ itemCode + "@" + lotNo); //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); errString = itmDBAccessEJB.getErrorString("","VTRATE1","","",conn);
return errString; return errString;
} }
...@@ -1019,6 +1035,10 @@ public class PostOrdDespatchGen ...@@ -1019,6 +1035,10 @@ public class PostOrdDespatchGen
if(mrate<0) if(mrate<0)
{ {
// System.out.println(">Rate is not proper for !!! "+ itemCode + "@" + lotNo); // 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); errString = itmDBAccessEJB.getErrorString("","VTRATE1","","",conn);
return errString; return errString;
} }
...@@ -1988,7 +2008,8 @@ public class PostOrdDespatchGen ...@@ -1988,7 +2008,8 @@ public class PostOrdDespatchGen
private static String generateTranId(String windowName, String userId, Connection conn) throws Exception 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; ResultSet rs = null;
String sql = ""; String sql = "";
String tranId = ""; String tranId = "";
...@@ -1996,9 +2017,12 @@ public class PostOrdDespatchGen ...@@ -1996,9 +2017,12 @@ public class PostOrdDespatchGen
CommonConstants commonConstants = new CommonConstants(); CommonConstants commonConstants = new CommonConstants();
try try
{ {
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 = '"+windowName+"'";
stmt = conn.createStatement(); sql = "SELECT KEY_STRING, TRAN_ID_COL, nvl(REF_SER,'PEXRE') FROM TRANSETUP WHERE TRAN_WINDOW = ? ";
rs = stmt.executeQuery(sql); //stmt = conn.createStatement();
pstmt = conn.prepareStatement();
pstmt.setString(1, windowName)
rs = pstmt.executeQuery();
// System.out.println("keyString :"+rs.toString()); // System.out.println("keyString :"+rs.toString());
String keyString = ""; String keyString = "";
String keyCol = ""; String keyCol = "";
...@@ -2009,6 +2033,10 @@ public class PostOrdDespatchGen ...@@ -2009,6 +2033,10 @@ public class PostOrdDespatchGen
keyCol = rs.getString(2); keyCol = rs.getString(2);
tranSer = rs.getString(3); tranSer = rs.getString(3);
} }
rs.close();//23feb19[to close the cursor and pstmt while retuing string]
rs = null;
pstmt.close();
pstmt = null;
String xmlValues = ""; String xmlValues = "";
//System.out.println("keyCol"+keyCol); //System.out.println("keyCol"+keyCol);
//System.out.println("keyString"+keyString); //System.out.println("keyString"+keyString);
......
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