?
Solved

java.sql.SQLException: No row count was produced

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

770 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