Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

want to delete the record fom db

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

in my appln i want to delete record from database

i have set deleted flag 1


my qury for deletion :-->


public static final String GET_FUNDSHARE_DETAILS = "SELECT SHARE_ID,SHARE_TYPE,BASE_CRNCY_CD,ACTIVE, LAUNCH_DT,ISIN,COM_CD,WPKNR,SEDOL,VALOREN,MEX_ID,CUSIP,EURO_CLEAR FROM WK_SHARE WHERE FUND_ID=? and DELETED = '0'";


public static final String AD_SHARE = "insert into wk_share values(?,wk_share_seq.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?)";


public static final String MODIFY_SHARE = "update wk_share set SHARE_TYPE=?,BASE_CRNCY_CD=?,ACTIVE=?,LAUNCH_DT=?,ISIN=?,COM_CD=?,WPKNR=?,SEDOL=?,VALOREN=?,MEX_ID=?,CUSIP=?,EURO_CLEAR=? WHERE SHARE_ID=?";


public static final String DELETE_SHARE = "update wk_share set deleted='1' where fund_id=? and share_id=? ";

}


my DAO class for delete m.d is as follows
public boolean deleteFundShare(String fundId , String shareId )throws KMSSystemException{

logger.info("ShareToFundDAO :: deleteFundShare :: Inside");
ResultSet resultSet = null;
PreparedStatement preparedStmt = null;
boolean isUpdate = false;
try{
conn = ServiceLocator.getInstance().getConnection();

// Delete Shares
preparedStmt = new LoggableStatement(conn, DELETE_SHARE);
preparedStmt.setString(1, fundId);
preparedStmt.setString(2, shareId);
SharesToFundDVO sharesToFundDVO = new SharesToFundDVO();
sharesToFundDVO.setDeleted(KMSConstants.ACTIVE_YES);
logger.debug("ShareToFundDAO :: deleteFundShare :: Query to delete share :: "+((LoggableStatement)preparedStmt).getQueryString());


isUpdate = preparedStmt.execute();

conn.commit();
ServiceLocator.closeAll(conn,resultSet,preparedStmt);
}catch(SQLException sqlExec){
logger.debug("ShareToFundDAO :: deleteFundShare :: SQLException ::",sqlExec);
throw new KMSSystemException("error.sharestofund.dao.sqlException",sqlExec);
} catch(KMSSystemException kmsExec){
logger.debug("ShareToFundDAO :: deleteFundShare :: KMSSystemException ::",kmsExec);
throw new KMSSystemException("error.sharestofund.dao.kmsException",kmsExec);
}


logger.info("ShareToFundDAO :: deleteFundShare :: Exit");
return isUpdate;
}




my action class as follows :-->




} else if(null != mode && mode.trim().equals(KMSConstants.MODE_DELETE)){


sharesToFundValidationHelper.deleteFundShare("1233","24" );
forward = mapping.findForward("search");

}
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, there is no question in your post. How then can you expect an answer?

Secondly, this is clearly a database issue. Why are you posting it in the Struts forum instead of the JDBC forum?
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are 5 or 6 posts on this topic, one is "not all variables bound" in Oracle/OAS forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic