
The type NewsDaoImpl must implement the inherited abstract method NewsDao.update(Object)
packagecn.jbit.easybuy.dao.impl;importjava.sql.Connection;importjava.sql.PreparedStat...
package cn.jbit.easybuy.dao.impl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import cn.jbit.easybuy.dao.NewsDao;
import cn.jbit.easybuy.entity.easy_comment;
import cn.jbit.easybuy.entity.easybuy_news;
import cn.jbit.easybuy.entity.Pager;
import cn.jbit.easybuy.util.Validator;
public class NewsDaoImpl extends BaseDaoImpl implements NewsDao {
public NewsDaoImpl(Connection connection) {
super(connection);
}
//根据新闻ID删除新闻
public void delete(Long id) throws SQLException {
String sql = " DELETE FROM easybuy_news where en_id=?";
PreparedStatement ps = connection.prepareStatement(sql);
ps.setLong(1, id);
ps.executeUpdate();
ps.close();
}
}
写代码时遇到了The type NewsDaoImpl must implement the inherited abstract method NewsDao.update(Object)这样的问题,求指教,急用。 展开
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import cn.jbit.easybuy.dao.NewsDao;
import cn.jbit.easybuy.entity.easy_comment;
import cn.jbit.easybuy.entity.easybuy_news;
import cn.jbit.easybuy.entity.Pager;
import cn.jbit.easybuy.util.Validator;
public class NewsDaoImpl extends BaseDaoImpl implements NewsDao {
public NewsDaoImpl(Connection connection) {
super(connection);
}
//根据新闻ID删除新闻
public void delete(Long id) throws SQLException {
String sql = " DELETE FROM easybuy_news where en_id=?";
PreparedStatement ps = connection.prepareStatement(sql);
ps.setLong(1, id);
ps.executeUpdate();
ps.close();
}
}
写代码时遇到了The type NewsDaoImpl must implement the inherited abstract method NewsDao.update(Object)这样的问题,求指教,急用。 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
1个回答
2014-12-27
展开全部
再写一个update方法
public void update(News news){
...............
}
public void update(News news){
...............
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询