任何一个请解决此错误。 我在选择查询中看到错误,但我没有得到,并且在下面的代码中还有一个错误是缺少大括号。我需要通过将用户名作为主键从另一个jsp页面获取详细信息
enter code here
<%@page import ="java.sql.*" %>
<%@ 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>
<form>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306 /","root","scott");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select *from come2links.user_details where USerName="+requestgetParameter("uName"));
//int count=1;
while(rs.next())
{
String FisrtName=rs.getString("FirstName");
String LastName=rs.getString("LastName");
Date dob = rs.getDate("DOB");
String address=rs.getString("Address");
String UserName=rs.getString("UserName");
String Password=rs.getString("Password");
//int Salary=rs.getInt("sal");
%>
%>
<form name="updatef1" action="" >
First name:<br>
<input type="text" name="firstname" value="<%=FisrtName%>"/>
<br>
Last name:<br>
<input type="text" name="lastname" value="<%=LastName%>"/>
<br>
DOB:<br>
<input type="text" name="DOB" value="<%=dob%>"/>
<br>
Address:<br>
<input type="text" name="Address" value="<%=address%>"/>
<br>
UserName:<br>
<input type="text" name="UserName" value="<%=UserName%>" readonly/>
<br>
Password:<br>
<input type="text" name="Password" value="<%=Password%>"/>
<br>
<input type="submit" value="Update"/>
<br>
</form>
</body>
</html>