This is just a simple query in Employee database using Employee ID where ID is an integer value. I did following operation to parse the value of ID in integer.
String value = request.getParameter("Employee_ID");
int id = Integer.parseInt(value);
// Step 3: Execute a SQL SELECT query
String sqlStr = "select * from Employee where ID = id ";
but it gives me following error:
Multiple markers at this line
- Line breakpoint:QueryServlet [line: 45] - doGet(HttpServletRequest,
HttpServletResponse)
- The value of the local variable id is not used
My html file:
<html>
<head>
<title>Employee Details</title>
</head>
<body>
<h2>Employee Details</h2>
<form method="get" action="http://localhost:9999/abcd/query">
<b>Select Employee ID:</b>
<input type="text" name="Employee_ID" value="ex101">
<input type="submit" value="Search">
</form>
</body>
</html>