int diffanalysis=Integer.parseInt(history.getDiffanalysisHours()) ;
int AnalysisHours= Integer.parseInt(project.getAnalysisHours());
history.setDiffanalysisHours(String.valueOf(AnalysisHours-diffanalysis));
projectService.saveorupdate(history);
I have a problem , I want the second last entered data of history bean. How should I go about it?
I can get previous data but I want the data entered before that.
the most obvious way that comes to my mind is to store last and second_last values and update them at every insert you do. the update could easily be done with a procedure or something.
another solution would be to add a column creation_date which will take the value of the insert date and time. then select the first two ordered by creation_date.