File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes want to delete the record Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "want to delete the record" Watch "want to delete the record" New topic

want to delete the record

Ranch Hand

Joined: Sep 19, 2006
Posts: 49

in my appln i want to delete record from database

for that i have add deleted flag in respective table

tell me how to use deleted flag in DAO class to delete

the record

my DAO class

public boolean modifyFundShare(SharesToFundDVO sharesToFundDVO,String clientName,String fundName,String mchNumber,boolean isDelete)throws KMSSystemException{"ShareToFundDAO :: modifyFundShare :: Inside");

ResultSet rs = null;
PreparedStatement ps = null;
String shareId = null;
String shareType = null;
String currency = null;
String active = null;
Date launchDate = null;
String isinCode = null;
String comCode = null;
String wpknr = null;
String sedol = null;
String velorenTelekurs = null;
String mexid = null;
String cusip = null;
String euroclearEligible = null;
boolean update = false;
conn = ServiceLocator.getInstance().getConnection();
shareId = sharesToFundDVO.getShareId();
shareType = sharesToFundDVO.getShareType();
currency = sharesToFundDVO.getCurrency();
active = sharesToFundDVO.getActive();
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
if(null != sharesToFundDVO.getLaunchDate() && !sharesToFundDVO.getLaunchDate().equals("")){
launchDate = new Date(formatter.parse(sharesToFundDVO.getLaunchDate()).getTime());
isinCode = sharesToFundDVO.getIsinCode();
comCode = sharesToFundDVO.getComCode();
wpknr = sharesToFundDVO.getWpknr();
sedol = sharesToFundDVO.getSedol();
velorenTelekurs = sharesToFundDVO.getVelorenTelekurs();
mexid = sharesToFundDVO.getMexid();
cusip = sharesToFundDVO.getCusip();
euroclearEligible = sharesToFundDVO.getEuroclearEligible();

ps = new LoggableStatement(conn, DELETE_SHARE);
ps.setString(1, shareId);
logger.debug("ShareToFundDAO :: modifyFundShare :: Query to delete Shares :: "+((LoggableStatement)ps).getQueryString());

ps = new LoggableStatement(conn, MODIFY_SHARE);

ps.setString(1, shareType);
ps.setString(2, currency );
ps.setString(3, active);
ps.setDate(4, launchDate);
ps.setString(5, isinCode);
ps.setString(6, comCode);
ps.setString(7, wpknr);
ps.setString(8, sedol);
ps.setString(9, velorenTelekurs);
ps.setString(10, mexid);
ps.setString(11, cusip);
ps.setString(12, euroclearEligible);
ps.setString(13, shareId);

logger.debug("ShareToFundDAO :: modifyFundShare :: Query to modify shares :: "+((LoggableStatement)ps).getQueryString());

update = ps.execute();
} catch(SQLException sqlExec){
logger.debug("SharesToFundDAO :: modifyFundShare :: SQLException :: ",sqlExec);
throw new KMSSystemException("error.sharestofund.dao.sqlException",sqlExec);
} catch(KMSSystemException kmsExec){
logger.debug("SharesToFundDAO :: modifyFundShare :: KMSSystemException :: ",kmsExec);
throw new KMSSystemException("error.sharestofund.dao.kmsException",kmsExec);
} catch(Exception ex){
}"ShareToFundDAO :: modifyFundShare :: Exit");
return update;
I agree. Here's the link:
subject: want to delete the record
It's not a secret anymore!