This week's book giveaway is in the Testing forum.
We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line!
See this thread for details.
Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

want to delete the record

Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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;
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic