I am trying to use a Java application (which I do not have the source code for) to output the results of a call to a stored procedure into a text file.
This file works for other similar stored procedures in the system, but I can’t seem to get it to produce anything for my new text file other than this exception:
ResultSet is from UPDATE: No Data
I’ve simplified the body of the stored procedure to a simple select 'Hello World!' and even that doesn’t seem to be able to be written out.
Is there anything I can do within the stored procedure to produce results in a fashion that Java will accept?
I encountered this
java.sql.SQLException. In my case I was running a query in this way:rs.next()throws the exception. The reason is that, due to the comments,queryresults to be:hence it’s all commented… query is invalid! Many examples could be shown with this mistake (with the comment in the middle of the query etc.).
Solutions: add a
\nat the end of each line of the query or use comments in the/*...*/form.