It looks like each time you read the values from the database, you are reading everything and re-inserting. Hence you double the number of times each user exists.
Have a look at the way you use your while(rs.next()), consider adding a 'where' clause to the query and using an 'if(rs.next())' instead.
I have to admit I just browsed the code and didn't read it all, it's a bit too much to digest.