主题:恳求高手给予指点
下面的程序if不好用是为什么呀?
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.sql.*" %>
<%
String name1=request.getParameter("ming");
String password1=request.getParameter("password");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:db2";
Connection con=DriverManager.getConnection(url,"","");
Statement stmt=con.createStatement();
String select1="select * from 表1 where name='"+name1+"'and
password='"+password1+"'";
ResultSet rs=stmt.executeQuery(select1);
if(rs.getString!=null){
%>
<jsp:forward page="wan.jsp">
<jsp:param name="r" value="12"/>
</jsp:forward>
<%}%>
[em7][em6][em7]
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.sql.*" %>
<%
String name1=request.getParameter("ming");
String password1=request.getParameter("password");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:db2";
Connection con=DriverManager.getConnection(url,"","");
Statement stmt=con.createStatement();
String select1="select * from 表1 where name='"+name1+"'and
password='"+password1+"'";
ResultSet rs=stmt.executeQuery(select1);
if(rs.getString!=null){
%>
<jsp:forward page="wan.jsp">
<jsp:param name="r" value="12"/>
</jsp:forward>
<%}%>
[em7][em6][em7]