java - 在这一行发现了多个注释。MyConnection 无法解决
问题描述
我正在尝试将此 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();
}
%>
解决方案
推荐阅读
- python - ModuleNotFoundError on pythonanywhere
- eclipse-plugin - SWT 类的 Eclipse 插件启动错误 NoClassDefFoundError
- python - How to create specific file format with core Python
- java - 按类别排序时如何避免并发修改异常?
- ssis - SSIS test, ADO.net connection with SQL authenticated user fails, OLEDB works
- c# - C# MVC 有限阅读器excel
- jenkins - Jenkins SCM 插件,如何获取自上次构建以来每个更新文件的列表?
- javascript - 网页中的多个不同背景
- r - 试图在ggplot中加粗y轴
- r - Cleaning legacy country records in R dataframe