简单页面数据输不出来
数据输不出来,帮忙给看看,谢谢了
程序如下:
<%@page contentType="text/html; charset=gb2312"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*"%>
<%@page import="java.sql.*"%>
<html>
<head>
<title>登录页面</title>
</head>
<body bgcolor="lavender">
<%String name="";%>
<%String pass="";%>
<%name=request.getParameter("username");%>
<%pass=request.getParameter("mima");%>
<%=name%>
<%=pass%>
<%String url = "jdbc:odbc:zhuce"; %>
<%String subS="select * from users where LogID='"+name+"' and LogPw='"+pass+"' ";%>
<%=subS%>
<%try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection(url,"","");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery(subS);
while(rs.next())
{%>
<%=rs.getString("LogID")%>
<p>
<%=rs.getString("LogPw")%>
<%}%>
<%rs.close();stmt.close();con.close();}
catch(Exception e){
System.out.println(e);}%>
<hr>
</body>
</html>