Oops! My apology. Thanks Mahesh.
Actually when I was unable to update data on stars table I was trying that code with jobs table but the result was same that means no updation happened to jobs table also. So when i was posting the code mistakenly I has copied the last code where jobs table was used.
Anyway I have modified the code for stars table using try catch block. Have a look:
The output is:
No. of rows updated: 0 Connection closed