MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 密码 帐号的修改,该怎么解决

密码 帐号的修改,该怎么解决(2)

www.MyException.Cn  网友分享于:2013-02-14  浏览:21次

Java code

package com.ycom;


public class UserTest {

    private UserDao dao = new UserDao();
    
    public void addTest(){
        UserInfo user = new UserInfo();
        user.setUserName("zhangsan");
        user.setPassword("wwww");
        dao.addUser(user);
        printUsersInfo();
    }

    public void delTest() {
        dao.delUser("zhangsan");
        printUsersInfo();
    }

    public void modifyTest() {
        dao.modifyUser("zhangsan", "00000");
        printUsersInfo();
    }

    private void printUsersInfo(){
        for(UserInfo user : dao.getAllUsers()){
            System.out.println(user.getUserName()+"  "+user.getPassword());
        }
    }
    
    public static void main(String[] args) {
        UserTest ut = new UserTest();
        ut.addTest();
    }
}

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有