aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes SQL Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic
Author

SQL Exception

shumani edzani
Greenhorn

Joined: Oct 03, 2008
Posts: 9
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

Joined: Feb 19, 2008
Posts: 2902
    
    1

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 !!


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

I don't think this is related to SCJP in any way...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14153
    
  18

Double post.

Please carefully choose one forum when you post a question on JavaRanch.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL Exception