心的统计数据,只主动偏股型基金整体上小幅减仓.35个百分点至.14,股票仓位水平与最近 三年来的均值相当。其中,只主动股票型基金一季报平均股票仓位为.148,较年年报微降.96 insert into news values('环卫女工怕费鞋赤脚扫积水每年长个月冻疮','记者微访(史 凤玲)几经周折,记者昨天在唐家墩车站附近找到了这位赤脚环卫工,她叫陈素珍,今年岁。事 实上,几平凡遇有积水,年来她都会打赤脚扫,即便在寒风刺骨的冬天,她亦如此。她说,这样 “不坏鞋 而她的鞋 全部都是地摊上买来的二手货,最贵的 双才块钱。 insert int0 news values('高速飞米铁片可机忍剧痛救名乘客','25日晚,青银高速淄博 段,一辆行驶的大巴车挡风玻璃被从天而降的铁片击碎,司机宋丰升胸口被击中。他强忍剧痛, 减速、停车、开双闪,停稳车,联系其他车,将名乘客安全送走。他被诊断为根肋骨骨折,肺部 受伤。愿好人平安!·,5 insert into ew ues(日媒称中国余架军机曾在的鱼岛为执法船护航',·【环球网综 合报道】日本《产经新闻》月日援引多名日政府高官消息称,中国艘海监船相继进入钓鱼岛海里 执法的月日当天,曾有多架中国军机出现在钓鱼岛海域周边空域,且中方军机中多半为战斗机, 包括中国空军新型战机苏-27和苏-30。《产经新闻》分析称,中国军机是想通过不断的遥近, 止日本航空自卫队的般机飞行员形成疲劳。日本政府高官称:”这是前所未闻的威防。·,2) insert into new values('朝鲜起诉一名韩裔美国人最高或面临死刑,'中新网月日电据 美联杜报道,朝鲜方面日称,韩育美国人肯尼斯 ,装以“反朝敌对罪行 鲜最高法院起诉,拘 很快接受判决。一名朝鲜官员对美联社说,肯尼斯·裴可能将面临严重的刑罚,最高或面临死刑。 ·,11 insert into news values(·传阿里入股新浪微博即将揭晓不排除全盘收购可能',·腾讯科 技方楚4月日报道中国互联网今年最重磅的交易或将很快揭晓。阿里巴巴入股新浪微博的传闻已 流传很久,腾讯科技获悉,新浪或将很快宜布与阿里巴巴的资本合作,不排除阿里巴巴全盘收购 新浪微博的可能。·,2) insert into news values('教有部否认新研究生收费制度不利寒门学子',·中新网月日电 2013年月日16:53完善研究生教有投入【学校用于研究生奖励资助的投入将增加】新机制实施 后,学校收入将比之前大幅增加,体现在围家财政拨款增加和学费收入增加,围家对所有纳入国 家计划的全日制研究生均安排定颜,且大幅提高按款标准,另外,所有纳入国家计划的全日 制研究生都要缴纳学费 ,4) select from newstype select from news
5 心的统计数据,只主动偏股型基金整体上小幅减仓.35个百分点至.14%,股票仓位水平与最近 三年来的均值相当。其中,只主动股票型基金一季报平均股票仓位为.14%,较年年报微降.96 个百分点,高于近三年以来均值.63个百分点;只混合型基金一季报平均股票仓位为.36%,较 年年报下降.01个百分点,低于近三年以来均值.37个百分点。',3); insert into news values('环卫女工怕费鞋赤脚扫积水每年长个月冻疮','记者微访(史 凤玲)几经周折,记者昨天在唐家墩车站附近找到了这位赤脚环卫工,她叫陈素珍,今年岁。事 实上,几乎凡遇有积水,年来她都会打赤脚扫,即便在寒风刺骨的冬天,她亦如此。她说,这样 “不坏鞋”,而她的鞋,全部都是地摊上买来的二手货,最贵的一双才块钱。',5); insert into news values('高速飞来铁片司机忍剧痛救名乘客','25日晚,青银高速淄博 段,一辆行驶的大巴车挡风玻璃被从天而降的铁片击碎,司机宋丰升胸口被击中。他强忍剧痛, 减速、停车、开双闪,停稳车,联系其他车,将名乘客安全送走。他被诊断为根肋骨骨折,肺部 受伤。愿好人平安!',5); insert into news values('日媒称中国余架军机曾在钓鱼岛为执法船护航','【环球网综 合报道】日本《产经新闻》月日援引多名日政府高官消息称,中国艘海监船相继进入钓鱼岛海里 执法的月日当天,曾有多架中国军机出现在钓鱼岛海域周边空域,且中方军机中多半为战斗机, 包括中国空军新型战机苏-27和苏-30。《产经新闻》分析称,中国军机是想通过不断的逼近, 让日本航空自卫队的战机飞行员形成疲劳。日本政府高官称:“这是前所未闻的威胁。',2); insert into news values('朝鲜起诉一名韩裔美国人最高或面临死刑','中新网月日电据 美联社报道,朝鲜方面日称,韩裔美国人肯尼斯·裴以“反朝敌对罪行”被朝鲜最高法院起诉,将 很快接受判决。一名朝鲜官员对美联社说,肯尼斯·裴可能将面临严重的刑罚,最高或面临死刑。 ',1); insert into news values('传阿里入股新浪微博即将揭晓不排除全盘收购可能','腾讯科 技方堃4月日报道中国互联网今年最重磅的交易或将很快揭晓。阿里巴巴入股新浪微博的传闻已 流传很久,腾讯科技获悉,新浪或将很快宣布与阿里巴巴的资本合作,不排除阿里巴巴全盘收购 新浪微博的可能。',2); insert into news values('教育部否认新研究生收费制度不利寒门学子','中新网月日电 2013年月日16:53 完善研究生教育投入【学校用于研究生奖励资助的投入将增加】新机制实施 后,学校收入将比之前大幅增加,体现在国家财政拨款增加和学费收入增加,国家对所有纳入国 家计划的全日制研究生均安排定额拨款,且大幅提高拨款标准,另外,所有纳入国家计划的全日 制研究生都要缴纳学费。',4); select * from newstype select * from news
2、创建表对应的JavaBean 新建JAVA WEB Project ,在工程中增加对数据库支持的JAR包 (WebRoot/WEB-NF/lib目录下),并建立上面的两个表对应的JavaBcan News Type Bean 和NewsBean,内容为: (1)cn.sdut.po.NewsTypeBean.javacn.sdut.po.NewsBean package cn.sdut.po; public class NewsTypeBean private int newstypeid; private String newstypename; public int getNewstypeid(){ return newstypeid; public void setNewstypeid(int newstypeid)[ this.newstypeid newstypeid; public String getNewstypename()( return newstypename public void setNewstypename(String newstypename){ this.newstypename newstypename; package cn.sdut.po; public class NewsBean private int newsid; private String newstitle private String newscontent private int newstypeid; public int getNewsid() return newsid; public void setNewsid(int newsid)( this.newsid newsid public String getNewstitle(){ return newstitle; public void setNewstitle(String newstitle){ this.newstitlenewstitle; 6
6 2、创建表对应的 JavaBean 新 建 JAVA WEB Project — — News , 在工程中 增 加 对 数 据 库 支 持 的 JAR 包 (WebRoot/WEB-INF/lib 目录下),并建立上面的两个表对应的 JavaBean——NewsTypeBean 和 NewsBean,内容为: (1)cn.sdut.po.NewsTypeBean.java 和 cn.sdut.po.NewsBean package cn.sdut.po; public class NewsTypeBean { private int newstypeid; private String newstypename; public int getNewstypeid() { return newstypeid; } public void setNewstypeid(int newstypeid) { this.newstypeid = newstypeid; } public String getNewstypename() { return newstypename; } public void setNewstypename(String newstypename) { this.newstypename = newstypename; } } package cn.sdut.po; public class NewsBean { private int newsid; private String newstitle; private String newscontent; private int newstypeid; public int getNewsid() { return newsid; } public void setNewsid(int newsid) { this.newsid = newsid; } public String getNewstitle() { return newstitle; } public void setNewstitle(String newstitle) { this.newstitle = newstitle; }
public String getNewscontent(){ return newscontent; public void setNewscontent(String newscontent)( this.newscontent newscontent; public int getNewstypeid(){ return newstypeid public void setNewstypeid(int newstypeid){ this.newstypeid newstypeid; 3、建立数据库操作的接口 (I)新建cn.sdut.dao包,用于存放接口。 (2)建立接口NewsTypeDao,定义对“新闻类型表”一newstype的常用操作方法,代码如 下: package cn.sdut.dao; ava. public interface NewsTypeDao public int addNewsType (NewsTypeBean newsType);// public int de1 NewsType(int newsTypeId);/别除 Publie int update wsType(NewsTypeBe ype):/修 pub1 c List se1ecta11 NewsType):/查询所有记录 Pub1 ic NewsTypeBean selectNewsTypeById(int newsTypeId);/根据主键查询记 (3)建立接口Me ,定义对“新闻表”一news的常用操作方法,代码如下: import java.util.List; import cn.sdut.po.NewsBeant public interface NewsDao public int addNews(NewsBean news)//增加 blic int delNews(int newsId)/别除 public int updateNews(NewsBean news);// pub11cL1stse1ecta11News();/查询所有记录 public NewsBean selectNewsById(int newsId):/根据主键查询记录 public List selectNewsByTypeId(int newsTypeId);/根据新问类别查询记录
7 public String getNewscontent() { return newscontent; } public void setNewscontent(String newscontent) { this.newscontent = newscontent; } public int getNewstypeid() { return newstypeid; } public void setNewstypeid(int newstypeid) { this.newstypeid = newstypeid; } } 3、建立数据库操作的接口 (1)新建 cn.sdut.dao 包,用于存放接口。 (2)建立接口 NewsTypeDao,定义对“新闻类型表”—newstype 的常用操作方法,代码如 下: package cn.sdut.dao; import java.util.List; import cn.sdut.po.NewsTypeBean; public interface NewsTypeDao { public int addNewsType(NewsTypeBean newsType); //增加 public int delNewsType(int newsTypeId); //删除 public int updateNewsType(NewsTypeBean newsType); //修改 public List selectAllNewsType(); //查询所有记录 public NewsTypeBean selectNewsTypeById(int newsTypeId); //根据主键查询记 录 } (3)建立接口 NewsDao,定义对“新闻表”—news 的常用操作方法,代码如下: package cn.sdut.dao; import java.util.List; import cn.sdut.po.NewsBean; public interface NewsDao { public int addNews(NewsBean news); //增加 public int delNews(int newsId); //删除 public int updateNews(NewsBean news); //修改 public List selectAllNews(); //查询所有记录 public NewsBean selectNewsById(int newsId); //根据主键查询记录 public List selectNewsByTypeId(int newsTypeId); //根据新闻类别查询记录 }
4、建立数据库操作的实现类 (I)新建cn.sdutdao.impl包,用于存放实现接口的类。 (2)在cn.sdut.dao.impl包中放置类BaseDao,java,其中定义了数据库的连接方法,创建了 几个常用的数据库操作对象,如:数据库连接对象Connection con,语句对象Statements丈, 预编译对象PreparedStatement ps,结果集对象ResultSet rs:另外,还有关闭这些对象的方 法。内容如下: package cn.sdut.dao.impl: import java.sql.Connection; import java.sql.DriverManager: import java.sql.PreparedStatement. import java.sqI.ResultSet. importjavaql.SQLException: import java.sql.Statement. public class BaseDao Connection con: Statement st ResultSet rs: public Connection getConn() try Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"). con-DriverManager.getConnection("jdbe:sqerver://localhost:1433:databaseName-news""s a,123" catch (SQLException e) //TODO Auto-generated catch block e printStackTrace() catch (ClassNotFoundException e) TODOAuto-generated catch block e.printStack Trace(): return con; public void clsAll(
8 4、建立数据库操作的实现类 (1)新建 cn.sdut.dao.impl 包,用于存放实现接口的类。 (2)在 cn.sdut.dao.impl 包中放置类 BaseDao.java,其中定义了数据库的连接方法,创建了 几个常用的数据库操作对象,如:数据库连接对象 Connection con,语句对象 Statement st, 预编译对象 PreparedStatement pst,结果集对象 ResultSet rs;另外,还有关闭这些对象的方 法。内容如下: package cn.sdut.dao.impl; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class BaseDao { Connection con; PreparedStatement pst; Statement st; ResultSet rs; public Connection getConn() { try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); con=DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=news","s a","123"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } return con; } public void closeAll() {
if(rs!=null) rs.close() if(st!=null) if(pst!=null) pstclose() if(con!=null) con.close() catch(SQLExceptione) /TODOAuto-generated catch block e.printStackTrace() (3)建立接口NewsTypeDao的实现类NewsTypeDaoImpl package cn.sdut.dao.impl; import java.sgl.SQLException; import java.util.ArrayList; import java.util.List; import cn.sdut.dao.NewsTypeDao; import cn.sdut.po.NewsTypeBean; public class NewsTypeDaoImpl extends BaseDao implements NewsTypeDao{ public int addNewsType(NewsTypeBean newsType)( return 0; public int delNewsType(int newsTypeId)( return 0; public List selectAllNewsType()(
9 try { if(rs!=null) { rs.close(); } if(st!=null) { st.close(); } if(pst!=null) { pst.close(); } if(con!=null) { con.close(); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } (3)建立接口 NewsTypeDao 的实现类 NewsTypeDaoImpl package cn.sdut.dao.impl; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import cn.sdut.dao.NewsTypeDao; import cn.sdut.po.NewsTypeBean; public class NewsTypeDaoImpl extends BaseDao implements NewsTypeDao { public int addNewsType(NewsTypeBean newsType) { return 0; } public int delNewsType(int newsTypeId) { return 0; } public List selectAllNewsType() {