?? customer.java
字號:
package fangsoft.testcenter.model;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.IOException;
public class Customer {
public static boolean login(String userId, String password, Connection con)
throws IOException, SQLException {
PreparedStatement ps = null;
ResultSet result = null;
String pword = null;
String sqlString = "select password " + "from customer"
+ " where name=?";
ps = con.prepareStatement(sqlString);
ps.setString(1, userId);
result = ps.executeQuery();
if (result.next()) {
pword = result.getString("password");
} else
return false;
if (pword.equals(password))
return true;
else
return false;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -