作者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