Solved

Before start of result set ???

Posted on 2002-04-10
8
291 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Lamba in java 8 9 242
caughtSpeeding java challenge 16 136
Adjusting width and height of dropdown produced using select n option HTML tags 4 76
countXY challenge 28 151
One of the biggest threats in the cyber realm pertains to advanced persistent threats (APTs). This paper is a compare and contrast of Russian and Chinese APT's.
Knowing where your website is hosted is as important as the features you receive, the monthly fee, and the support you receive. Due diligence should be done when choosing your next hosting provider.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

776 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