eclipse运行是报错500
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
String username2="";
String password2="";
username2=request.getParameter("username1");
password2=request.getParameter("password1");
String sql="insert into user(username,password) values(?,?)";
Class.forName("com.mysql.jdbc.Driver");
String url="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8";
Connection connection = DriverManager.getConnection(url, "root", "123456");
PreparedStatement pstmt=connection.prepareStatement(sql);
pstmt.setString(1,username2);
pstmt.setString(2,password2);
try{
int n=pstmt.executeUpdate();
if(n==1){%>
恭喜你,添加成功!<br>
<%}
else{%>
添加失败,请重试。<br>
<%}
}catch(Exception e){
%>已重复添加,请重试<br>
<a href="Add.jsp">点击此处返回</a>
<%;
}
if(pstmt!=null){pstmt.close();}
if(connection!=null){connection.close();}
%>
</body>
</html>![图片说明](https://img-ask.csdn.net/upload/202006/22/1592823975_389844.png)
```前一天还可以用,第二天开机运行就错了,数据库已经链接了的,账号密码也没有错误d