File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes  no  data  found  exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark " no  data  found  exception" Watch " no  data  found  exception" New topic

no data found exception

prabhat gupta

Joined: Aug 21, 2001
Posts: 26
I m getting an exception like
" java.sql.SQLException: No Data found "
i m using tomcat server and MS SQL as backend.Though i m able to run the query successfully in query analyser and fetch the results ,it does not work in my jsp page.
i m calling a prepared statement and passing an int as a parameter
My query is like this:
pstmt=con.prepareStatement("select userdata.db_user_id,db_user_first,db_user_midl,db_user_last,db_desig_name from executivedata,userdata,designationmaster where db_exec_catg='EXECUTIVE' and db_exec_level=? and executivedata.db_user_id=userdata.db_user_id and userdata.db_desig_id=designationmaster.db_desig_id");
is it that the query is not able to fetch the tables and hence no results.please help me get rid of this problem.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Did you verify that this statement pstmt.setInt(1,(i+1)) is producing correct results. i.e Does "i + 1" produce what you are expecting? It seems like you may be calling the resultset's next() method without any valid data.

So much trouble in the world -- Bob Marley
I agree. Here's the link:
subject: no data found exception
It's not a secret anymore!