Now for some suggestions on the code itself.
1) Having scriptlet or plain old
Java code in JSP is highly outdated, like dinosaur age. All your code should be a
servlet, it is doint nothing good for a JSP.
2) You need to rethink the SQL query you are using, among other things, it will be a victim of SQL injection.
3) It is a good practice to use appropriate variable names. Having "name" refer to an email only attracts confusion.
When you fix these, there are more improvements that can be done.