I am practicing for the OCP exam, and I wrote the following, which combines bits I found on Youtube as well as from Mala Gupta's book:
The issue I encounter is that when I have the executeUpdate as it is in the code above, with it in between the ResultSet creation and processing of the ResultSet in the while loop, I get the following runtime exception:
However, if I move the executeUpdate statement to before the ResultSet is created, or to after the ResultSet while loop, I don't get this exception. In all cases, the table was created successfully. Can anyone please explain this?