Buggy code:
public class User { public int userID ; public String username ; public String password ; public String homepageURL ; public int permission ; public boolean isBlocked ; public boolean isDead ; public int practiceNumber ; public int highScoreNumber ; public final int IS_NORMAL = 0 ; public final int IS_ADMIN = 1 ; public final int IS_TEMP = 2 ; public final int IS_FRIEND = 1 ; public final int NOT_FRIEND = 0 ; public final int PENDING_FRIEND = 2 ; public final int REVERSE_PENDING = 3 ; public static final String DBTable = "users" ; public static final String FriendDBTable = "friendship" ; public ArrayList < User > getFriendList ( ) { } public ArrayList < QuizTakenRecord > getQuizHistory ( ) { } public ArrayList < QuizCreatedRecord > getCreatedQuiz ( ) { } public ArrayList < Achievement > getAchievements ( ) { } public ArrayList < NoteMessage > getNoteMessages ( ) { } public ArrayList < FriendRequestMessage > getFriendRequestMessages ( ) { } public ArrayList < ChallengeMessage > getChallengeMessages ( ) { } public User ( String username , String password , String homepageURL , int permission ) { } public User ( int userID , String username , String password , String homepageURL , int permission , boolean isBlocked , boolean isDead , int practiceNumber , int highScoreNumber ) { } public void addUserToDB ( ) { try { String statement = new String ( ( ( ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>" + ( User . DBTable ) ) + "<seq2seq4repair_space>(username,<seq2seq4repair_space>password,<seq2seq4repair_space>url,<seq2seq4repair_space>permission,<seq2seq4repair_space>isblocked,<seq2seq4repair_space>isdead,<seq2seq4repair_space>practicenumber,<seq2seq4repair_space>highscorenumber)" ) + "<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?)" ) ) ; <START_BUG> PreparedStatement stmt = con . prepareStatement ( statement , new String [ ] { "id" } ) ; <END_BUG> stmt . setString ( 1 , username ) ; stmt . setString ( 2 , password ) ; stmt . setString ( 3 , homepageURL ) ; stmt . setInt ( 4 , permission ) ; stmt . setBoolean ( 5 , isBlocked ) ; stmt . setBoolean ( 6 , isDead ) ; stmt . setInt ( 7 , practiceNumber ) ; stmt . setInt ( 8 , highScoreNumber ) ; stmt . executeUpdate ( ) ; ResultSet rs = stmt . getGeneratedKeys ( ) ; rs . next ( ) ; userID = rs . getInt ( "userid" ) ; rs . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } public static User getUserByUsername ( String username ) { } public static User getUserByUserID ( int userID ) { } public void updateCurrentUser ( ) { } public static void removeUser ( User user ) { } public void addFriend ( User user ) { } public void removeFriend ( User user ) { } public int isFriend ( User user ) { } public void addMessage ( Message message ) { } public void addAnnouncement ( String title , String content ) { } public void promoteUser ( User user ) { } public void editQuiz ( Quiz quiz ) { } public boolean equals ( User other ) { } }

Fix:
PreparedStatement stmt = con . prepareStatement ( statement , new String [ ] { "userid" } ) ;