Solved

Before start of result set ???

Posted on 2002-04-10
8
285 Views
Last Modified: 2008-02-26
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")+"'"
0
Comment
Question by:yan_er04
8 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6933754
can you post your entire code.. and point out where the error is?
0
 
LVL 2

Assisted Solution

by:coreyit
coreyit earned 25 total points
ID: 6934386
Try outputing the boolean returned by result1.next() to see if you actually received anything.

-corey
0
 
LVL 92

Accepted Solution

by:
objects earned 25 total points
ID: 6941015
I'd say your query is returning no rows.
Check your query returns something.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Expert Comment

by:coreyit
ID: 6942823
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
 
LVL 92

Expert Comment

by:objects
ID: 6943354
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
 
LVL 2

Expert Comment

by:coreyit
ID: 6943429
good point
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 9553217
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

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now