【发布时间】:2014-09-08 15:17:24
【问题描述】:
这只是在员工数据库中使用员工 ID 进行的简单查询,其中 ID 是一个整数值。我做了以下操作来解析整数 ID 的值。
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 ";
但它给了我以下错误:
Multiple markers at this line
- Line breakpoint:QueryServlet [line: 45] - doGet(HttpServletRequest,
HttpServletResponse)
- The value of the local variable id is not used
我的html文件:
<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>
【问题讨论】:
-
您的问题有什么错误?一个是断点,另一个是警告。我在您的问题中找不到任何错误
-
@msrd0 问题是 OP 想要/需要使用这个
id变量,但它无法做到。