《JSP笔记》之七(数据库mysql)

chap9-7.jsp <%@ page contentType=\<%@ page import=\

简单登录窗口

login.jsp <%@ page contentType=\<%@ page import=\ 登录处理程序 <%

Connection con; Statement sql; ResultSet rs; try{

Class.forName(\ } catch(ClassNotFoundException e){ out.println(e); } con=DriverManager.getConnection(\ sql=con.createStatement();

String name=request.getParameter(\ String pw=request.getParameter(\

String str1=\

rs=sql.executeQuery(str1); if(rs.next()){ out.print(\恭喜你,\,登陆成功!\ } else{ out.print(\抱歉!\,用户名或者密码错误\ } %>

联系客服:779662525#qq.com(#替换为@)