Have you checked the server log for the problem cause? What has happened should have logged down there.
Beside your database problem, pay attention on....
- Invoking
JDBC codes directly from your servlet class is not a good practice.
You should have separate classes for database access.
- Storing the inputs without having proper validations is inherently insecure and prone to
SQL injection attacks.