??????????????
???????????? ???????[ 2016/1/22 14:57:54 ] ???????????????
????### С?飺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???????????????????????????????????????????????????????????????
??????
???·???
App??С????H5?????????????????Щ??
2024/9/11 15:34:34?????????????????????????
2024/9/10 11:13:49P-One ???????????????????????????????????????
2024/9/10 10:14:12???????????????????????????
2024/9/9 18:04:26??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44

sales@spasvo.com