??????????????
???????????? ???????[ 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???????????????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11