loadrunner安装指南
out.println("你输入的密码为:
"+codeToString(request.getParameter("userpassword"))); %>
<%
Statement statement;
ResultSetrs;
// 加载驱动程序以连接数据库
try {
Class.forName("com.mysql.jdbc.Driver");
Connection connection =
DriverManager.getConnection("jdbc:mysql://localhost:3306/hacker", "root", "root"); System.out.println("连接成功");
statement=connection.createStatement();
rs=statement.executeQuery("select password from user where
username="+"'"+request.getParameter("username")+"'");
if(rs.next())
{
String bb = rs.getString("password");
System.out.println("tongguo");
if(request.getParameter("userpassword").equals(bb))
out.println("登陆成功");
}
else
out.println("登陆失败");
connection.close();
}
// 捕获加载驱动程序异常
catch (ClassNotFoundExceptioncnfex) {
System.err.println("装载 JDBC/ODBC 驱动程序失败。");
// cnfex.printStackTrace();
//System.exit(1); // terminate program