2012年4月5日
摘要: 用oracle sql对数字进行操作: 取上取整、向下取整、保留N位小数、四舍五入、数字格式化取整(向下取整): select floor(5.534) from dual; select trunc(5.534) from dual; 上面两种用法都可以对数字5.534向下取整,结果为5. 如果要向上取整 ,得到结果为6,则应该用ceil select ceil(5.534) from dual;四舍五入: SELECT round(5.534) FROM dual; SELECT round(5.534,0) FROM dual; SELECT round(5.534,1) FROM .. 阅读全文
posted @ 2012-04-05 11:35 it_code 阅读(16353) 评论(0) 推荐(0) 编辑
  2012年3月30日
摘要: tomcat服务器连接池知识什么是敏捷开发简单的说,敏捷开发是一种以人为核心、迭代、循序渐进的开发方法。在敏捷开发中,软件项目的构建被切分成多个子项目,各个子项目的成果都经过测试,具备集成和可运行的特征。换言之,就是把一个大项目分为多个相互联系,但也可独立运行的小项目,并分别完成,在此过程中软件一直处于可使用状态。Tomcat中配置连接池步骤本方法的原理是,在%CATALINA%\conf\server.xml中设置数据库的连接属性,在应用目录的/WEB-INF/web.xml中配置一个引用,然后在应用中的/META-INF/context.xml中将以上两个配置联系起来。所以真正产生连接的是 阅读全文
posted @ 2012-03-30 09:42 it_code 阅读(5759) 评论(0) 推荐(0) 编辑
  2012年3月26日
摘要: http://kb.cnblogs.com/page/129756/ 阅读全文
posted @ 2012-03-26 14:17 it_code 阅读(185) 评论(0) 推荐(0) 编辑
  2012年3月19日
摘要: /* * @author * 2005-12-14 */ Calendar calendar = Calendar.getInstance(); //getTime()方法是取得当前的日期,其返回值是一个java.util.Date类的对象 res.setResOpenDate(calendar.getTime()); int day = calendar.get(Calendar.DAY_OF_YEAR); calendar.set(Calendar.DAY_OF_YEAR, day + 30); //投票的有效期30天 res.setResEndDate(calendar.g... 阅读全文
posted @ 2012-03-19 14:19 it_code 阅读(5708) 评论(0) 推荐(0) 编辑
  2012年3月9日
摘要: 很多时候我们在遇到map遍历时,我们首先会想到的是用for循环一个一个的遍历,但有没有想过用迭代器Iterator呢?下面是一个用Iterator遍历map的例子for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){ Map.Entry entry = (Map.Entry) iter.next(); String key = (String) entry.getKey(); String value = (String ) entry.getValue();}可能大家觉得这没什么,还得申请Iterator,并不值... 阅读全文
posted @ 2012-03-09 13:32 it_code 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 要求查询出tab中3月1-10号的每天1-10点数据select * from tab where (to_number(to_char(date,'hh'),'99') between 1 and 10)and date between to_date('2012-3-1','yyyy-mm-dd') and to_date('2012-3-10') 阅读全文
posted @ 2012-03-09 13:19 it_code 阅读(121) 评论(0) 推荐(0) 编辑
  2012年2月9日
摘要: http://www.cnblogs.com/Hero-Qiang/archive/2012/02/09/2343492.html 阅读全文
posted @ 2012-02-09 09:25 it_code 阅读(296) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/napoleon_liu/articles/2020759.html 阅读全文
posted @ 2012-02-09 09:01 it_code 阅读(141) 评论(0) 推荐(0) 编辑
  2012年2月8日
摘要: public List<StatisticsPO> statisticsEducationStatus(int sType, String districtCode, String parm1, String parm2, String examType) { List<StatisticsPO> rList = new ArrayList(); Connection conn = null; CallableStatement cs = null; ResultSet rs = null; try { conn = SessionFactoryUtils.get... 阅读全文
posted @ 2012-02-08 14:52 it_code 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 我们一般在用到Hibernate写sql查询时,有的时候list 中的Object并不是已有的Model,所以一般我们会重新新建一个Model。 方法一:在Dao层中编写。Spring框架支持持久层开发public List<MyObj> getList(int rid, String name){ List<MyObj> list = new ArrayList(); Connection conn = null; Statement cs = null; ResultSet rs ... 阅读全文
posted @ 2012-02-08 14:46 it_code 阅读(2768) 评论(0) 推荐(1) 编辑