)刚开始学java写了个小程序,一直报错找了半天也不知道什么问题,请高手指点? 5
java.lang.NullPointerExceptioncom.dao.imp.UsersDao.check(UsersDao.java:100)com.biz.im...
java.lang.NullPointerException
com.dao.imp.UsersDao.check(UsersDao.java:100)
com.biz.imp.UsersBiz.check(UsersBiz.java:38)
com.action.imp.UsersAction.check(UsersAction.java:41)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
public Users check(Users us) {
String sql="select * from users where uname=? and passwd=?";
rst=DBHelper.executeQuery(sql, new String[]{
us.getUname(),us.getPasswd()
});
try {
if(rst.next()){
us=new Users(rst.getString(1), rst.getString(2), rst.getString(3), rst.getString(4), rst.getString(5), rst.getString(6), rst.getString(7), rst.getString(8));
return us;
} 展开
com.dao.imp.UsersDao.check(UsersDao.java:100)
com.biz.imp.UsersBiz.check(UsersBiz.java:38)
com.action.imp.UsersAction.check(UsersAction.java:41)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
public Users check(Users us) {
String sql="select * from users where uname=? and passwd=?";
rst=DBHelper.executeQuery(sql, new String[]{
us.getUname(),us.getPasswd()
});
try {
if(rst.next()){
us=new Users(rst.getString(1), rst.getString(2), rst.getString(3), rst.getString(4), rst.getString(5), rst.getString(6), rst.getString(7), rst.getString(8));
return us;
} 展开
1个回答
2016-06-18
展开全部
UsersDao.java:100 空指针异常 , 在check方法里打断点 调试一下
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询