YUGH!!!!!!
You don't properly close your database resource, you use String concatenation all over the place, you have massive scriptlets in a JSP, you place business logic in a JSP, you don't use code tags.
And you don't seem to understand what you're doing.
Of course it stores all null values when you call the page as those request parameters won't have been set.
And most likely the error on subsequent calls is a primary key violation from trying to insert another null value (I guess you declared username to be unique).
Reputation Points: 1658
Solved Threads: 331
duckman
Offline 7,719 posts
since Nov 2004