[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

java.sql.SQLException: No row count was produced

Posted on 1998-11-18
2
Medium Priority
?
3,467 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 120 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

649 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