aspose file tools*
The moose likes Struts and the fly likes want to delete the record fom db 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 fom db" Watch "want to delete the record fom db" New topic
Author

want to delete the record fom db

Pradeep
Ranch Hand

Joined: Sep 19, 2006
Posts: 49
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

Joined: Feb 15, 2005
Posts: 4864
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?


Merrill
Consultant, Sima Solutions
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
There are 5 or 6 posts on this topic, one is "not all variables bound" in Oracle/OAS forum.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: want to delete the record fom db