Commit 26ef0798 authored by smane's avatar smane

FreightListIC.java file updated by sagar changes made in genCode method


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94389 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 082b4ec6
......@@ -53,16 +53,16 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
}
errString = wfValData(dom, dom1, dom2, objContext, editFlag, xtraParams);
}
catch(Exception e)
{
}
catch(Exception e)
{
System.out.println("Exception : [FreightListIC][wfValData( String, String )] :==>\n" + e.getMessage());
throw new ITMException(e);
}
return(errString);
}
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
}
return(errString);
}
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException
{
String childNodeName = null;
String errString = "";
String errCode = "";
......@@ -322,13 +322,9 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
errFields.add(childNodeName.toLowerCase());
}
}
}
}// end for
break; // case 1 end
}
int errListSize = errList.size();
......@@ -354,12 +350,12 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
{
break;
}
}
errList.clear();
errList = null;
errFields.clear();
errFields = null;
errStringXml.append("</Errors> </Root> \r\n");
}
errList.clear();
errList = null;
errFields.clear();
errFields = null;
errStringXml.append("</Errors> </Root> \r\n");
}
else
{
......@@ -397,14 +393,12 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
d.printStackTrace();
throw new ITMException(d);
}
}
errString = errStringXml.toString();
return errString;
}
}
errString = errStringXml.toString();
return errString;
}
//end of validation
// method for item change
// Start method for item change
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{
Document dom = null;
......@@ -435,10 +429,9 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
System.out.println("Exception : [FreightListIC][itemChanged( String, String )] :==>\n" + e.getMessage());
throw new ITMException(e);
}
return valueXmlString;
return valueXmlString;
}
// method for item change
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{
......@@ -550,9 +543,8 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
valueXmlString.append("</Detail1>");
break;
}
valueXmlString.append("</Root>");
}
valueXmlString.append("</Root>");
}
catch(Exception e)
{
......@@ -588,19 +580,16 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
}
return valueXmlString.toString();
}
private String checkNull(String input)
{
if(input == null)
{
input = "";
}
return input;
}
private String errorType(Connection conn , String errorCode) throws ITMException
{
private String checkNull(String input)
{
if(input == null)
{
input = "";
}
return input;
}
private String errorType(Connection conn , String errorCode) throws ITMException
{
String msgType = "";
PreparedStatement pstmt = null ;
ResultSet rs = null;
......@@ -618,14 +607,14 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
rs = null;
pstmt.close();
pstmt = null;
}
catch(Exception ex)
{
}
catch(Exception ex)
{
ex.printStackTrace();
throw new ITMException(ex);
}
finally
{
}
finally
{
try
{
if(rs != null)
......@@ -644,29 +633,48 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
e.printStackTrace();
throw new ITMException(e);
}
}
return msgType;
}
return msgType;
}
private String getGenCodeDescr(Connection conn,String fieldName,String fieldVal) throws ITMException
{
String descr = null;
String descr = "";
String sql="";
PreparedStatement pstmt=null;
ResultSet rs=null;
try
{
String sql="select descr from gencodes where MOD_NAME = ? and fld_name = ? and fld_value = ?";
System.out.println(">>>>Check for gencode W_FRT_LIST:"+fieldVal);
sql="select descr from gencodes where MOD_NAME = ? and fld_name = ? and fld_value = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, "X");
pstmt.setString(1, "W_FRT_LIST");
pstmt.setString(2, fieldName);
pstmt.setString(3, fieldVal);
rs=pstmt.executeQuery();
if(rs.next())
{
descr=rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(descr==null || descr.trim().length() == 0 )
{
System.out.println(">>>>Check for gencode X:"+fieldVal);
sql="select descr from gencodes where MOD_NAME = ? and fld_name = ? and fld_value = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, "X");
pstmt.setString(2, fieldName);
pstmt.setString(3, fieldVal);
rs=pstmt.executeQuery();
if(rs.next())
{
descr=rs.getString(1);
}
}
descr=checkNull(descr);
descr=descr.trim();
System.out.println(">>>>>>getGenCodeDescr"+descr);
......@@ -676,19 +684,15 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
System.out.println("[FreightListIC] SQLException : getGenCodeDescr(): \n SQLException Occured =>>"+se.getMessage());
se.printStackTrace();
throw new ITMException(se);
}
catch (Exception e)
{
System.out.println("[FreightListIC] Exception : getGenCodeDescr(): \n Exception Occured =>>"+e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs!=null){
......@@ -706,23 +710,17 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
se.printStackTrace();
throw new ITMException(se);
}
}
return descr;
}
private int getDBRowCount(Connection conn, String table_name, String whrCondCol, String whrCondVal)
{
int count=-1;
if(conn!=null){
if(conn!=null)
{
ResultSet rs=null;
PreparedStatement pstmt = null;
String sql="select count(1) from "+table_name+" where "+whrCondCol+" = ?";
System.out.println("SQL in getDBRowCount method : "+sql);
try
......@@ -744,7 +742,9 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
{
System.out.println("Exception In getDBRowCount method of FreightListIC Class : "+ex.getMessage());
ex.printStackTrace();
}finally{
}
finally
{
try{
......@@ -763,16 +763,18 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
se.printStackTrace();
}
}
}else
}
else
{
try
{
throw new SQLException("Connection passed to FreightListIC.getDBRowCount() method is null");
} catch (SQLException e) {
}
catch (SQLException e)
{
e.printStackTrace();
}
}
}
return count;
}
}
}
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