毕业设计论文:不能超过20个字

上传人:jiups****uk12 文档编号:40032815 上传时间:2018-05-22 格式:DOC 页数:18 大小:1.41MB
返回 下载 相关 举报
毕业设计论文:不能超过20个字_第1页
第1页 / 共18页
毕业设计论文:不能超过20个字_第2页
第2页 / 共18页
毕业设计论文:不能超过20个字_第3页
第3页 / 共18页
毕业设计论文:不能超过20个字_第4页
第4页 / 共18页
毕业设计论文:不能超过20个字_第5页
第5页 / 共18页
点击查看更多>>
资源描述

《毕业设计论文:不能超过20个字》由会员分享,可在线阅读,更多相关《毕业设计论文:不能超过20个字(18页珍藏版)》请在金锄头文库上搜索。

1、毕毕业业设设计计(2009 届)届)设计(论文)题目设计(论文)题目 不能超过不能超过 20 个字个字 学学 院院 名名 称称 计计 算算 机机 与与 信信 息息 学学 院院 专专 业业 (班(班 级)级) 计计 算算 机机 科科 学学 与与 技技 术(术(*班)班) 姓姓 名名 (学(学 号)号) 指指 导导 教教 师师 系系(教教研研室室)负负责责人人 20092009 年年 6 6 月月 1313 日日这是一个由 MyEclipse 制作的动态网页里面集成了管理员登陆留言以及新闻的增删改查 并且连接数据库,是一个可交互的动态网站 下面是本项目的具体介绍首先是新闻的评论系统的模板点击新闻后

2、可以进行评论并且添加了一个登录的验证方法小功能如下所示当登陆过后会进入一个管理员的界面可以获取到登陆的用户点击登录控制台会通过链接到达一个管理的界面点击 login out 可以退出登录可以修改和删除各条新闻以下是修改的界面点击提交可以更改新闻更新新闻成功后弹出窗口提示成功同样的我们也可删除新闻,并且也会弹出相应的对话框来提示成功或者失败来 提示删除新闻下面就是在删除之后的新闻显示版面、删除非主流,真可怕 既然是增删改查怎么可以少了它呢 下面就是添加新闻的功能展示 同志们请睁大你们的眼睛注意了这里是添加新闻的界面简单大方凸显我的个性发布失败!好吧, ,这里是我故意失败的。这是为了证明我做的是有

3、对话框来提示的同样这里通过“单击事件”点击确定来回到控制台页面在这些的基础之上我还写了各个网站都比不可少的分页功能、以上就是本网站的功能,下面是部分代码package org.jbit.news.dao;import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException;public class BaseDao protected Connection con; p

4、rotected PreparedStatement ps; protected ResultSet rs; /获取连接 public boolean openConnection() try Class.forName(“oracle.jdbc.driver.OracleDriver“); con = DriverManager.getConnection(“jdbc:oracle:thin:localhost:1521:orcl“, “zzy“, “zzy“); catch (ClassNotFoundException e) e.printStackTrace(); return fal

5、se; catch (SQLException e) e.printStackTrace(); return false; return true; /执行 delete 操作 public int executDelete(String sql) openConnection(); int delete_rows = 0; try ps = con.prepareStatement(sql); delete_rows = ps.executeUpdate(); catch (SQLException e) e.printStackTrace(); finally closeResource(

6、); return delete_rows; /关闭资源 public boolean closeResource()try if(rs != null) rs.close(); if(ps != null) ps.close(); if(con != null) con.close(); catch (SQLException e) e.printStackTrace(); return false; return true; import java.util.List; import java.util.Map;public interface NewsDao /获取所有新闻 public

7、 List getAllnews(); /通过分页获取所有新闻 public List getAllnewsByPage(int page_info_no, int page_no); /通过分页获取选择主题下的所有新闻 public List getAllnewsByPageAndTid(int page_info_no, int page_no, String tid); /返回新闻数目 public int countNews(); /通过新闻 id 获取新闻 public Map getNewsByNid(String nid); /获取选择主题下所有新闻 public List ge

8、tNewByTid(String tid); /更新选择的新闻 public int updateNews(Map news); /添加新闻 public int addNews(Map news); /删除新闻 public int deleteNews(String nid); /按照主题显示新闻 public List getNewsByType(int page_info_no, int page_no); package org.jbit.news.biz.impl;import java.util.List; import java.util.Map;import org.jbit

9、.news.biz.NewsBiz; import org.jbit.news.dao.NewsDao;public class NewsBizImpl implements NewsBiz private NewsDao nd; public NewsDao getNd() return nd; public void setNd(NewsDao nd) this.nd = nd; public int addNews(Map news) return nd.addNews(news); public int deleteNews(String nid) return nd.deleteNe

10、ws(nid); public Map findNewsByNid(String nid) return nd.getNewsByNid(nid); public List findNewsByPage(int page_info_no, int page_no, String tid) if(page_info_no = 0) if(tid = null | tid.equals(“) return nd.getAllnews(); else return nd.getNewByTid(tid); else if(tid = null | tid.equals(“) return nd.ge

11、tAllnewsByPage(page_info_no, page_no); else if(tid.equals(“-getTypes“) return nd.getNewsByType(page_info_no, page_no); else return nd.getAllnewsByPageAndTid(page_info_no, page_no, tid); public int updateNews(Map news) return nd.updateNews(news); public int countNews() return nd.countNews(); package

12、org.jbit.news.dao.impl;import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; import java.util.Map;import org.jbit.news.bean.Comment; import org.jbit.news.dao.BaseDao; import org.jbit.news.dao.CommentsDao;public class CommentsDaoImpl exten

13、ds BaseDao implements CommentsDao /通过 nid 查找评论 public List getCommentsByNid(String nid) openConnection(); List list = new ArrayList(); SimpleDateFormat sdf = new SimpleDateFormat(“yy-MM-dd HH:mm“); String sql = “select * from comments“ + “ where cnid = “ + nid + “ order by cdate desc“; try ps = con.

14、prepareStatement(sql); rs = ps.executeQuery(); while(rs.next() Comment comment = new Comment(); comment.setCid(String.valueOf(rs.getInt(“cid“); comment.setCnid(String.valueOf(rs.getInt(“cnid“); comment.setCauthor(rs.getString(“cauthor“); comment.setCip(rs.getString(“cip“); comment.setCcontent(rs.get

15、String(“ccontent“); comment.setCdate(sdf.format(rs.getObject(“cdate“); list.add(comment); catch (SQLException e) e.printStackTrace(); finallycloseResource(); return list; public int deleteComment(String cid) openConnection(); String sql = “delete from comments where cid=“ + cid;int i = 0; try ps = con.prepareStatement(sql); i = ps.executeUpdate(); catch (SQLException e) e.printStackTrace(); finallycloseResource(); return i; public int coun

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号