As a beginner to Jsp, I'm building a simple web application that register/login users.
When i run the below code i'm getting the following error HTTP Status 500 - Internal Server Error
Building web application in eclipse and web server is tomcat. I've also downloaded and added the jar file.
Don't know what went wrong and couldn't find any helpful answer on google as yet.
i'm getting the same error for both the JSP(one for login and another for register)files in my project.

register.jsp file:

```
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<%@ page import ="java.sql.*" %>
<%@ page import ="javax.sql.*" %>
<%
    String user=request.getParameter("userid");
    session.putValue("userid",user);
    String pass=request.getParameter("pass");
    String fname=request.getParameter("fname");
    String lname=request.getParameter("lname");
    String email=request.getParameter("email");
    Class.forName("com.mysql.jdbc.Driver");
    java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/pms","root","root");
    Statement st=con.createStatement();
    ResultSet rs;
    int i= st.executeUpdate("insert into users values("+user+","+pass+","+fname+","+lname+","+email+")");

    out.println("Registered");

%>

<a href="Login.html">Login</a></br>
<a href="Comp.html">Home</a></br>

</body>
</html>

```

error:

```
HTTP Status 500 – Internal Server Error

Type Exception Report

Message An exception occurred processing [/register.jsp] at line [19]

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception
org.apache.jasper.JasperException: An exception occurred processing [/register.jsp] at line [19]

16:     String fname=request.getParameter("fname");
17:     String lname=request.getParameter("lname");
18:     String email=request.getParameter("email");
19:     Class.forName("com.mysql.jdbc.Driver");
20:     java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/pms","root","root");
21:     Statement st=con.createStatement();
22:     ResultSet rs;

```