本文共 4823 字,大约阅读时间需要 16 分钟。
    package bdqn.newsMange.Dao.Impl;import java.sql.ResultSet;import java.sql.SQLException;import java.util.ArrayList;import java.util.List;import bdqn.newsMange.Dao.BaseDao;import bdqn.newsMange.Dao.newsTbDao;import bdqn.newsMange.entity.newsTb;/** * 新闻的实现类 * @author Administrator * */public class newsTbDaoImpl extends BaseDao implements newsTbDao {	//查询	public List        getnewsTbAll() {		List          newsList=new ArrayList           ();				String sql="select * from newsTb";		try {			ResultSet rs=executeQurey(sql, null);			while(rs.next()){				newsTb ne=new newsTb();				ne.setNewsID(rs.getInt("newsid"));				ne.setTitle(rs.getString("title"));				ne.setAuthor(rs.getString("author"));				ne.setCreateDate(rs.getDate("CreateDate"));				ne.setCategoryID(rs.getInt("CategoryID"));				ne.setContent(rs.getString("Content"));				ne.setModifyDate(rs.getDate("ModifyDate"));				ne.setPicPath(rs.getString("PicPath"));				ne.setSummary(rs.getString("Summary"));				newsList.add(ne);			}		} catch (ClassNotFoundException e) {			// TODO Auto-generated catch block			e.printStackTrace();		} catch (SQLException e) {			// TODO Auto-generated catch block			e.printStackTrace();		}finally{			closeAll();		}		return newsList;	}	//添加	public int addNewsTb(newsTb news) {		int rel = 0;		List                     转载地址:http://jrktz.baihongyu.com/