我正在尝试将此index.jsp连接到数据库,但一直出现此错误
An error occurred at line: [7] in the jsp file: [/index.jsp]<br>
MyConnection cannot be resolved
4: <%@ page import="com.connection.*" %><br>
5: <%
6: Connection con = null;<br>
7: con = MyConnection.dbCon();<br>
8: PreparedStatement pst;<br>
9:
10: String id = request.getParameter("unq_id");
<%
Connection con = null;
con = MyConnection.dbCon();
PreparedStatement pst;
String id = request.getParameter("unq_id");
String userName = request.getParameter("username");
String pass = request.getParameter("password");
if(request.getParameter("Create Account") != null) {
String query = "INSERT INTO student (unq_id,username,password) VAUES(?,?,?)";
pst = con.prepareStatement(query);
pst.setString(1, id);
pst.setString(2, userName);
pst.setString(3, pass);
pst.executeUpdate();
}
%>