Solved

java.sql.SQLException: No row count was produced

Posted on 1998-11-18
2
3,416 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

728 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