Forums Register Login

no data found exception

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2138 times.
Similar Threads
Reading excel file with data in chinese language using jdbc
problem with using rs.getString() in servlet.
@ManyToMany and Select query
Retrieving data from database - Architecture issue
Prepared statement
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:09:50.