Commit 0b322cbe authored by dpawar's avatar dpawar

update date format of confirm date


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92400 ce508802-f39f-4f6c-b175-0d175dae99d5
parent df565333
......@@ -13,6 +13,7 @@ import javax.ejb.Stateless;
public class EmpBondDefConfirm extends ActionHandlerEJB implements EmpBondDefConfirmLocal,EmpBondDefConfirmRemote
{
String loginEmpCode="";
int updcnt1=0;
public String confirm(String tranId, String xtraParams, String forcedFlag) throws RemoteException,ITMException
{
......@@ -111,14 +112,13 @@ public class EmpBondDefConfirm extends ActionHandlerEJB implements EmpBondDefCon
rs.close();
rs = null;
}
System.out.println("UPDATE COUNT ---->>"+updCnt);
if (updCnt > 0)
updcnt1 =updateConfirm(conn,tranId);
System.out.println("UPDATE COUNT --updCnt-->>"+updCnt+" updcnt1 -->>"+updcnt1);
if (updCnt > 0 && updcnt1 >0 )
{
retString=new ITMDBAccessEJB().getErrorString("", "VCONFSUC", "", "", conn);
updateConfirm(conn,tranId);
conn.commit();
System.out.println("Bond amount and bond period updated successfully.......row(s) updated :"+updCnt);
System.out.println("Bond amount and bond period updated successfully.......");
}else
{
......@@ -170,26 +170,22 @@ public class EmpBondDefConfirm extends ActionHandlerEJB implements EmpBondDefCon
}
public void updateConfirm(Connection conn,String tranId)
public int updateConfirm(Connection conn,String tranId)
{
PreparedStatement pstmt1=null;
String sql = "UPDATE EMPLOYEE_BOND_DEF SET CONFIRMED = 'Y',CONF_DATE = ?,EMP_CODE__APRV=? WHERE TRAN_ID = ?";
int count=0;
String sql = "UPDATE EMPLOYEE_BOND_DEF SET CONFIRMED = ? ,CONF_DATE = ?,EMP_CODE__APRV=? WHERE TRAN_ID = ?";
try
{
GenericUtility genericUtility = GenericUtility.getInstance();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
String ConfDate = simpleDateFormat.format(timestamp).toString();
{
pstmt1 = conn.prepareStatement( sql );
pstmt1.setString(1, "Y");
pstmt1.setTimestamp(2, this.getCurrdateAppFormat());
pstmt1.setString(3, loginEmpCode);
pstmt1.setString(4, tranId);
pstmt1 = conn.prepareStatement( sql );
pstmt1.setString(1, ConfDate);
pstmt1.setString(2, loginEmpCode);
pstmt1.setString(3, tranId);
count = pstmt1.executeUpdate();
System.out.println("confirm updated -------->>>>>>>>>updCount :"+count);
int updCnt = pstmt1.executeUpdate();
System.out.println("in updateConfirm method ------CONF_DATE -->>>"+ConfDate);
System.out.println("confirm updated -------->>>>>>>>>updCount :"+updCnt);
}
catch(Exception e)
......@@ -219,7 +215,26 @@ public class EmpBondDefConfirm extends ActionHandlerEJB implements EmpBondDefCon
e.printStackTrace();
}
return count;
}
private java.sql.Timestamp getCurrdateAppFormat()
{
GenericUtility genericUtility = GenericUtility.getInstance();
Timestamp timestamp = null;
try
{
java.util.Date date = null;
timestamp = new Timestamp(System.currentTimeMillis());
SimpleDateFormat simpledateformat = new SimpleDateFormat(genericUtility.getDBDateFormat());
date = simpledateformat.parse(timestamp.toString());
timestamp = Timestamp.valueOf(simpledateformat.format(date).toString() + " 00:00:00.0");
}
catch(Exception exception)
{
System.out.println("Exception in [EmpBondDefConfirm] getCurrdateAppFormat " + exception.getMessage());
}
return timestamp;
}
}
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