Re: [問題] 資料庫取值的問題
: 沒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
討論串 (同標題文章)
java 近期熱門文章
PTT數位生活區 即時熱門文章