请教jsp问题高手留步
我做一个jsp登录页,但不知什么原因出错,高手给条明路代码如下:
<%
String user=new String(request.getParameter("user").getBytes("ISO-8859-1"));
String pass=new String(request.getParameter("pass").getBytes("ISO-8859-1"));
Connection conn;
Statement sql;
ResultSet rs;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(ClassNotFoundException e){}
try
{
conn=DriverManager.getConnection("jdbc:odbc:aa","","");
sql=conn.createStatement();
rs=sql.executeQuery("SELECT * FORM username WHERE username="+user+"password="+pass);
if(rs.next())
{
if(user.equals("user")&&pass.equals("password"))
{
response.sendRedirect("index.jsp");
}
else
{
out.print("您的密码或者用户名有误,请从新登录");
}
}
conn.close();
}
catch(SQLException e1){}
%>