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

SQL Exception

 
shumani edzani
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Report post to moderator
i have written this code in the hope of producing a chart but its throwing SQL Exception please help

public ActionForward deptChart(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {

try {
ReportWizardForm wizForm = (ReportWizardForm) form;

Formatting df = new Formatting();
String appraiser = "";
String appraisee = "";
if (wizForm.getAppraisee() != null
&& !wizForm.getAppraisee().equals("")) {
appraisee = wizForm.getAppraiseeID();
}
if (wizForm.getAppraiser() != null
&& !wizForm.getAppraiser().equals("")) {
appraiser = wizForm.getAppraiserID();
}
String startdate = "";
if (wizForm.getStartdate() != null) {
startdate = AppConstants.BEGINNING_DATE;
} else {
startdate = df.toNewDate(wizForm.getStartdate());
wizForm.setStartdate(startdate);
}
String enddate = "";
if (wizForm.getEnddate() != null
|| wizForm.getEnddate().equals("31 December 3000")) {
enddate = AppConstants.AMEN_DATE;
} else {
enddate = df.toNewDate(wizForm.getEnddate());
wizForm.setEnddate(enddate);
}
String score = wizForm.getScore();
// String frameworkID = wizForm.getFrameworkID();
String[] department = wizForm.getDepartment();
String scoreoperand = wizForm.getGreaterThan();

String orgId = wizForm.getOrganizationID();

AppraisalDto appDTO = new AppraisalDto();
AppraisalDAO appDAO = new AppraisalDAO();
appDTO.setGreaterThan(scoreoperand);
appDTO.setScorevalue(Float.valueOf(score));
appDTO.setAppraiseeid(appraisee);
appDTO.setAppraiserid(appraiser);
appDTO.setStates(wizForm.getAppraisalphase());
appDTO.setFirstupdated(Timestamp.valueOf(startdate));
appDTO.setLastupdated(Timestamp.valueOf(enddate));
// appDTO.setFrameworkid(frameworkID);
appDTO.setDepartments(department);
appDTO.setOrgId(orgId);
String appIDs = appDAO.reportWizardAppraisals(appDTO);
if (appIDs != null && !appIDs.equals("") && !appIDs.equals("'")) {
renderChart(appIDs, request, response);
} else {
return mapping.findForward("noResults");
}
wizForm.reset();
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
The best way solve any run time exception is to catch hem and print stack trace , which shows part of code with line number which has problem , also the the exception comes with message , which itself explains a lot !!

So post the exception message with line no at which its throwing it !!
 
Ankit Garg
Sheriff
Posts: 9510
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
I don't think this is related to SCJP in any way...
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Double post.

Please carefully choose one forum when you post a question on JavaRanch.
 
    Bookmark Topic Watch Topic
  • New Topic