| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1282 人关注过本帖
标题:不知道错在哪里?
只看楼主 加入收藏
海蓝啸
Rank: 5Rank: 5
来 自:安徽
等 级:贵宾
威 望:17
帖 子:1611
专家分:0
注 册:2006-4-3
结帖率:100%
收藏
 问题点数:0 回复次数:7 
不知道错在哪里?
package service;


import User.User;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import com.ibatis.dao.client.DaoException;
import java.sql.SQLException;
import javax.xml.rpc.ServiceException;
/**
 *
 * @author Administrator
 */
public class  UserService {
    private static User user = new User();
   
    public static User login(String UserCode, String UserPwd) throws DaoException, SQLException, ServiceException{
        return checkSystemUser(UserCode,UserPwd);
    }
   
    private static  User checkSystemUser(String UserCode,String UserPwd) throws DaoException, SQLException, ServiceException
    {
        User loginUser = UserService.getUserByCode(UserCode);
        if(loginUser==null)
            throw new ServiceException("用户不存在");
        String pwd=loginUser.getUserPwd();
        if((pwd)!=0)
            throw new ServiceException("密码不正确");
        return loginUser;         
    }
   
    private static User getUserByID(int id) throws DaoException, SQLException, ServiceException
    {
        User loginUser=user.findById(id);        
        if(loginUser==null)
            throw new ServiceException("用户没有找到");
        return loginUser;
        
    }
   
    private static User getUserByCode(String UserCode) throws DaoException, SQLException, ServiceException
    {
         User loginUser=user.findById(UserCode);         
         if(loginUser==null)
             throw new ServiceException("用户不存在");
         return loginUser;
    }
}


这是我项目里面的一个文件,搞不懂为什么红色部分总提示出错?
搜索更多相关主题的帖子: package service public change import 
2008-01-04 15:10
海蓝啸
Rank: 5Rank: 5
来 自:安徽
等 级:贵宾
威 望:17
帖 子:1611
专家分:0
注 册:2006-4-3
收藏
得分:0 
java.lang.ExceptionInInitializerError
提示这个错

这个社会太复杂。。。
2008-01-04 15:12
黄袖标
Rank: 4
等 级:贵宾
威 望:13
帖 子:676
专家分:0
注 册:2007-3-22
收藏
得分:0 
private change into public

or  evict   the keyword static

我胡汉三又回来啦!物是人非啊,只有静夜思大大还在。
2008-01-04 16:37
sea7
Rank: 2
等 级:新手上路
威 望:3
帖 子:291
专家分:0
注 册:2007-2-17
收藏
得分:0 
private 不能和 static同时放在一起吧

软件是一种修养
2008-01-04 21:07
海蓝啸
Rank: 5Rank: 5
来 自:安徽
等 级:贵宾
威 望:17
帖 子:1611
专家分:0
注 册:2006-4-3
收藏
得分:0 
谢谢

这个社会太复杂。。。
2008-01-07 08:51
wcbts520
Rank: 1
等 级:新手上路
帖 子:86
专家分:7
注 册:2007-10-11
收藏
得分:0 
问题
不能这样新建对象吧!!
2008-01-29 17:46
macrossyun
Rank: 1
等 级:新手上路
帖 子:56
专家分:0
注 册:2006-7-28
收藏
得分:0 
这个类不能用静态实例化吧。。。。。

初出茅庐
2008-01-29 17:51
marer
Rank: 2
等 级:新手上路
威 望:3
帖 子:928
专家分:0
注 册:2005-7-18
收藏
得分:0 
去掉static

public class 人生历程 extends Thread{public void run(){while(true){努力,努力,再努力!!;Thread.sleep(0);}}}
2008-01-31 11:27
快速回复:不知道错在哪里?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012794 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved