Hello folks I don't know where is the issue in the code can you help me please. ERROR 1: UsersDao is not abstract and does not override abstract method delete in DaoList. Error 2: Method does not override or implement a method from a supertype @Override
UsersDao.java :
public class Users extends db implements DaoList<Users>{
private static UsersDao userDao;
private UsersDao(){
}
public static UsersDao getInstance(){
if(userDao == null){
userDao = new UsersDao();
}
return userDao;
}
@Override
public List<UsersVo> loadAll(Users u) throws Exception {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int insert(Users u) throws Exception {
Connection con = null;
PreparedStatement ps = null;
int count = 0;
try{
con = getConnection();
String sql = "INSERT INTO USERS(USERNAME,PASSWORD,EMAIL) VALUES(?,?,?)";
ps = con.prepareStatement(sql);
ps.setString(1, u.getUserName());
ps.setString(2, u.getPassWord());
ps.setString(3, u.getEmail());
count = ps.executeUpdate();
}catch(Exception ex){
}finally{
ps.close();
closeConnection(con);
}
return count;
}
@Override
public int update(Users u) throws Exception {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int delete(Users u) throws Exception {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public PatientsVo getData(Users u) throws Exception {
throw new UnsupportedOperationException("Not supported yet.");
} }
insert
method in yourUsersDao
class has a different signature to that of theListDao
interface (i.e. theUserVo
parameter) hence the error for the@Override
annotation. 2. The implementation must implement all the methods in the interface.