This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

SQL Exception

shumani edzani
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());
String enddate = "";
if (wizForm.getEnddate() != null
|| wizForm.getEnddate().equals("31 December 3000")) {
enddate = AppConstants.AMEN_DATE;
} else {
enddate = df.toNewDate(wizForm.getEnddate());
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.setFrameworkid(frameworkID);
String appIDs = appDAO.reportWizardAppraisals(appDTO);
if (appIDs != null && !appIDs.equals("") && !appIDs.equals("'")) {
renderChart(appIDs, request, response);
} else {
return mapping.findForward("noResults");
Sagar Rohankar
Ranch Hand
Posts: 2907
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
Posts: 9529
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: 15495
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