作者wildrush (来跳土风舞吧)
看板java
标题Re: [问题] 资料库取值的问题
时间Fri Mar 3 12:12:18 2006
: 没code没真象
: ps. 有trim了吗
那是什麽@@??
底下是CODE
<%
String uid = request.getParameter("user");
String pwd =
new String(request.getParameter("password").getBytes("ISO-8859-1"));
Class.forName("net.sourceforge.jtds.jdbc.Driver");
Connection con =
DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/justRADIO");
Statement st1 = con.createStatement();
String sql1 ="select * from member where nember like '"+uid+"'";
ResultSet rs = st1.executeQuery(sql1);
rs.next();
String check =
new String(rs.getString("password").getBytes("ISO-8859-1"));
if (rs != null )
{
if(check.equals(pwd))
{
out.print("欢迎登入 "+uid);
}else
{
out.print("密码错误<br>请重新输入<BR>你输入的是<br>帐号:"+uid+"<br>密码:"+pwd);
out.print("<br>"+rs.getString("password"));
}
}
st1.close();
con.close();
%>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 203.73.201.223