????### С?飺The Expendables
??????????????

/*UsersDAO????*/
public class UsersDAO extends MyDAO{
//  private static JdbcUtil jdbcutil=new JdbcUtil();
public static boolean login(int type??String username??String password){
init();
String pwd=null;
try{
switch(type){
case 1:
sqlCommand="select * from ?? ?  where ????=?;";
break;
case 2:
sqlCommand="select * from ???????  where ????=?;";
break;
case 3:
sqlCommand="select * from ?????   where ????=?;";
break;
}
conn=JdbcUtil.getConnection();
pst=conn.prepareStatement(sqlCommand);
//          pst.setString(1?? tb_name);
pst.setString(1?? username);
rs=pst.executeQuery();
while(rs.next()){
pwd=rs.getString("????");
}
}catch(Exception e){
System.out.println(e.toString());
}
if(pwd==null||!pwd.equals(password)) return false;
else return true;
}
}
/*UsersDAOTest????*/
/*?????????????????????????????21001??????21001??*/
public class UsersDAOTest {
@Before
public void setUp() throws Exception {
}
@Test
public void testLogin() {
boolean result=UsersDAO.login(1?? "21001"?? "21001");
if(result) System.out.println("ok!");
else System.out.println("not ok!!");
}
}

????????????
????DB.properties works!
????com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'coursemanagement.??' doesn't exist
????not ok!!
??????鷢????????:
????/*???д????е?"???"???????????*/
????sqlCommand="select * from ?? ?  where ????=?;";
????????????????
????DB.properties works!
????ok!
?????????????
????1??eclipse????????????????????????????????
????2?????????????????????????????????????????????????????????“?????”???п??????????????????????????ps???????????????????????????????????????????????????????????????