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
......@@ -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();
......@@ -401,10 +397,8 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
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;
......@@ -438,7 +432,6 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
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,7 +543,6 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
valueXmlString.append("</Detail1>");
break;
}
valueXmlString.append("</Root>");
}
......@@ -588,7 +580,6 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
}
return valueXmlString.toString();
}
private String checkNull(String input)
{
if(input == null)
......@@ -597,8 +588,6 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
}
return input;
}
private String errorType(Connection conn , String errorCode) throws ITMException
{
String msgType = "";
......@@ -650,23 +639,42 @@ public class FreightListIC extends ValidatorEJB implements FreightListICLocal, F
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