Before start of result set ???

I have this sql which i hope is correct but when i tried to use count1, i keep getting this error. Before start of result set even though i did result1.next();

"SELECT custM_ID,custF_ID,date,count(dateID) as count1 from date_particular group by custM_ID,custF_ID having (count(custM_ID) = "+j+" or count(custF_ID) = "+j+") and month(date) = '"+request.getParameter("MONTH")+"' and year(date) = '"+request.getParameter("YR")+"'"
yan_er04Asked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
I'd say your query is returning no rows.
Check your query returns something.
0
 
cheekycjCommented:
can you post your entire code.. and point out where the error is?
0
 
coreyitConnect With a Mentor Commented:
Try outputing the boolean returned by result1.next() to see if you actually received anything.

-corey
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
coreyitCommented:
Checking the boolean value returned by ResultSet.next(), or, better, ResultSet.first(), should be sufficiently indicate whether or not you have any results.

-corey
0
 
objectsCommented:
I was suggesting running the query directly on the database, not thru Java. The problem may be in their construction of the query in Java.
0
 
coreyitCommented:
good point
0
 
KuldeepchaturvediCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between objects and coreyit.  
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Kuldeepchaturvedi
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.