
新闻发布项目——数据实现类(newsTbDaoImpl)
发布日期:2021-05-14 13:16:23
浏览次数:18
分类:精选文章
本文共 5310 字,大约阅读时间需要 17 分钟。
package bdqn.newsManage.Dao.Impl;import java.sql.ResultSet;import java.sql.SQLException;import java.util.ArrayList;import java.util.List;import bdqn.newsManage.Dao.BaseDao;import bdqn.newsManage.Dao.newsTbDao;import bdqn.newsManage.entity.newsTb;/** * ��������������������������� */public class newsTbDaoImpl extends BaseDao implements newsTbDao { // ������������������ public ListgetNewsTbAll() { List newsList = new ArrayList (); String sql = "SELECT * FROM newsTb"; try { ResultSet rs = executeQuery(sql, null); while (rs.next()) { newsTb news = new newsTb(); news.setNewsID(rs.getInt("newsid")); news.setTitle(rs.getString("title")); news.setAuthor(rs.getString("author")); news.setCreateDate(rs.getDate("CreateDate")); news.setCategoryID(rs.getInt("CategoryID")); news.setContent(rs.getString("Content")); news.setModifyDate(rs.getDate("ModifyDate")); news.setPicPath(rs.getString("PicPath")); news.setSummary(rs.getString("Summary")); newsList.add(news); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } finally { closeAll(); } return newsList; } // ������������ public int addNewsTb(newsTb news) { int result = 0; List
发表评论
最新留言
很好
[***.229.124.182]2025年04月27日 03时19分37秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
逃逸分析-堆分配对象
2021-05-14
常量池、运行时常量池
2021-05-14
3、条件查询
2021-05-14
5、分组函数 / 聚合函数
2021-05-14
8、子查询
2021-05-14
cordova打包apk更改图标
2021-05-14
开启与配置SMTP服务器
2021-05-14
域名解析步骤
2021-05-14
APP卡片式设计
2021-05-14
GitHub上传时,项目在已有文档时直接push出现错误解决方案
2021-05-14
云数据库
2021-05-14
大数据在不同领域的应用
2021-05-14
页面置换算法
2021-05-14
推荐系统资料
2021-05-14
文件系统的层次结构
2021-05-14
减少磁盘延迟时间的方法
2021-05-14
vue(渐进式前端框架)
2021-05-14
权值初始化和与损失函数
2021-05-14
案例讨论
2021-05-14
传输层基本功能
2021-05-14