• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error occured while initialising for loop:

 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi;
The bellow page shows the error at marked line as:can not find symbol count as i initialised before it:
kindly suggest modification




Thanks in advance
regards
Harshal
[ July 25, 2008: Message edited by: Harshal Gurav ]
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The count variable is declared in the try block just before the bold line, hence it's not visible in that exact line.
Declare the int count variable just before the opening try and you'll get your code to run.
 
Harshal Gurav
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Matteo;
Thank for your reply, after modifieng the code it shows erro in 4-count sql syntax as:operator + can not applied to java.lang.string,QNO.
Thanks and Regards
Harshal
 
Matteo Di Furia
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hm, can you provide the new source code and the exact error message ? I'm not completely sure about what's the next problem here. I see some problems in code which will probably come out after solving this one. For example, after setting some parameter like in



you should leave a blank space after the closing ', else you'll get SQL exceptions.
But regarding this very error (count sql syntax) I need to check the source code and the exact error message.
 
Harshal Gurav
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi matteo,
Thanks for your valuable suggestion.
In the below code I am getting output with no. of question only 8 which is first 8 in table while i am firing query for all 22 question. also gets count=22 so no error in for statement an i am peinting count value for checking.
2. I am getting count for all count query as 0.
Here is an updated code:


Here is output that i am getting



6 1 22 Question: How difficult did you find the course?
No. of A: 0 No. of B: 0 No. of C: 0 No. of D: 0

Question: How much outside work per week (excluding time spent in attending lectures) did the course entail?
No. of A: 0 No. of B: 0 No. of C: 0 No. of D: 0

Question: How easily were the books and articles recommended in the class available in the library?
No. of A: 0 No. of B: 0 No. of C: 0 No. of D: 0

Question: How useful did you find the suggested readings?
No. of A: 0 No. of B: 0 No. of C: 0 No. of D: 0

Question: Do you think a sufficient number of quizzes/exams were given?
No. of A: 0 No. of B: 0 No. of C: 0 No. of D: 0

Question: How helpful were the quizzes/exams?
No. of A: 0 No. of B: 0 No. of C: 0 No. of D: 0

Question: How fair were the exams (that counted towards your grade) testing your knowledge of the course material?
No. of A: 0 No. of B: 0 No. of C: 0 No. of D: 0

Question: Was classroom participation encouraged?
No. of A: 0 No. of B: 0 No. of C: 0 No. of D: 0




Any suggestion is highly appreciated
Thanks and Regards
Harshal
 
Matteo Di Furia
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suppose the where clauses in the select queries are excluding some of the results you desire to show. For example :



questionid and answer should bind all the B votes to this question, then why do you include a check for eventid and questionname values too ?
You might want to describe a bit your tables (Final and Questionbank) and tell us how they're bound together, especially including the meaning of the field "Questionname" (which if I don't misunderstood should be an int value).
 
Harshal Gurav
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi matteo,
Kindly refer the updated code that i had posted befor this post where i changed the name of colunm questionname as qserialno which is one column of table final.
In Questionbank table i have questionid as id for perticular type of question. one questionid may include several Qserialno.as no.of question related to that questionid.
1. I am finding no fo question filled in final table as i can get count of no.of question.
2.There is same data in eventid,questionid,Qserialno. column in both this table(Questionbank and final)
3. i am getting questionid and eventid from previous form. here i assumed int QNO = Qserialno. avilable in table and I am looping it.
so QNO increases rs will be point to next row.

I am not sure about where QNO.is looping or not?
Thanks and Regards
Harshal
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic