Solved

java.sql.SQLException: No row count was produced

Posted on 1998-11-18
2
3,330 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

914 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