Solved

java.sql.SQLException: No row count was produced

Posted on 1998-11-18
2
3,308 Views
Last Modified: 2008-03-17
Could anybody tell me why I got the SQLexception error message during run-time from the following codes? Thanks!

try{
      doQuery();
      boolean more = rs.next();
      if(more){
                   int  groupNo =rs.getInt("GroupNo");
        }

}catch(SQLException ex){
               System.out.println(ex);
   }

Here is the SQL gotten from the doQuery():
SELECT GroupNo FROM Costoms WHERE ID = 120


I checked my database, the record with ID = 120 exists in table "Customs"

0
Comment
Question by:leeann
2 Comments
 
LVL 16

Accepted Solution

by:
heyhey_ earned 40 total points
ID: 1227773
just a TYPO ? - COSTOMS ?

"SELECT GroupNo FROM Costoms WHERE ID = 120 "

if it's not just a typo, you'd better post more code (and if you tak a closer look at the exception stacktrace you'll see the exact line number where the exception occured ...)

  heyhey
0
 

Author Comment

by:leeann
ID: 1227774
Thanks! Now I find my problem is that I should use executeQuery(query),
rather than executeUpdate(query) in doQuery().
0

Featured Post

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

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

705 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

15 Experts available now in Live!

Get 1:1 Help Now