JDBC SQL SERVER: The statement did not return a result set
JDBC is getting confused by row counts.
You need to use SET NOCOUNT ON
.
Use execute
statement for data manipulation like insert, update and delete and
executeQuery
for data retrieval like select
I suggest you to separate your program into two statements one execute
and one executeQuery
.
If you do not wish to do that, try separating the statements with semi-colon. But I am not sure about this action if this gives you a resultset or not.