File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes  no  data  found  exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark " no  data  found  exception" Watch " no  data  found  exception" New topic
Author

no data found exception

prabhat gupta
Greenhorn

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");
pstmt.setInt(1,(i+1));
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: 1506
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.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: no data found exception
 
Similar Threads
@ManyToMany and Select query
Prepared statement
problem with using rs.getString() in servlet.
Retrieving data from database - Architecture issue
Reading excel file with data in chinese language using jdbc