public static User createUser(String username, String password, String fullname, int usertype){
        if(username == null || password == null || usertype < ADMIN || usertype > USER){
            return null;
        }        
        try {
            Connection con = DB.getConnection();
            PreparedStatement s = con.prepareStatement(CREATEUSER, Statement.RETURN_GENERATED_KEYS);
            s.setString(1, username);
            s.setString(2, password);
            s.setString(3, fullname);
            s.setInt(4, usertype);
            int result = s.executeUpdate();
            ResultSet res = s.getGeneratedKeys();
            if(res.next()){
                return new User(res.getInt(1), username, password, fullname, usertype);
            }            
        } catch(Exception e){
            e.printStackTrace();
        }
        return null;
    }