Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

no data found exception

 
prabhat gupta
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic