报错:Cannot make a static reference to the non-static method list(Connection, User) from the type UserDao
原因:UserDao是一个类名,类名只能调用静态方法,list(Connection, User)是非静态方法
解决方法:先定义全局变量private UserDao userDao=new UserDao();
,再调用userDao.list(con, user)
报错:Cannot make a static reference to the non-static method list(Connection, User) from the type UserDao
原因:UserDao是一个类名,类名只能调用静态方法,list(Connection, User)是非静态方法
解决方法:先定义全局变量private UserDao userDao=new UserDao();
,再调用userDao.list(con, user)