public static String DuStatusinactiveanddeactive(EmpBean empBeanObj,
ClaimDetailsBean claimDetailsBean,
HttpServletRequest request) throws SQLException {
// To get Employee Details from cdm master
String query = "update GEMS_DELIVERY_UNIT set isActive=? , TRANS_USER=? where DU_ID=?";
Connection conn = null;
conn = DAO.getMsSqlConnection();
PreparedStatement stmt = null;
//System.out.println("came into upgradeClaim"+beanObj.getAppr1Id()+"-->"+beanObj.getAppr2Id()+"-->"+beanObj.getAwaitingAppr()+"-->"+beanObj.getClaimStatus()+"-->"+beanObj.getClaimId());
try{
stmt = (PreparedStatement) conn.prepareStatement(query);
stmt.setString(1,claimDetailsBean.getDustatus());
System.out.println("ss"+claimDetailsBean.getDustatus());
stmt.setString(2,empBeanObj.getEmpId());
System.out.println("emp"+empBeanObj.getEmpId());
stmt.setString(3,claimDetailsBean.getDucode());
System.out.println("ducode"+claimDetailsBean.getDucode());
//where du_id=arr[0];
System.out.println(query);
stmt.executeUpdate();
}catch(Exception e){
e.printStackTrace();
return "fail";
}
return "Success";
}
now stmt.setString(3,claimDetailsBean.getDucode());來自動作方法值#1的值我需要拆分這個(值#1)並且只更新查詢值。我不想要#1 如何拆分和更新請任何一個幫助?如何分割值並更新查詢
請給我代碼我需要這個代碼 – arulmozhi
可以解釋更多,你正在尋找什麼.. – blganesh101
stmt.setString(3,claimDetailsBean.getDucode());這個地方如何拆分getDucode()? – arulmozhi