文章分类 -  code collect

根据年份和月份判断当月有多少天
摘要:1 /** 2 * 日期辅助方法,传入年和月份,返回当月天数 3 * @param year 4 * @param month 5 * @return 6 */ 7 public static int getDaysByYearAndMonth(String year,String month){ 8 boolean isLeapYear = false ; 9 int yearInfo = Integer.parseInt(year);10 ... 阅读全文

posted @ 2013-06-14 11:12 lylyalong 阅读(540) 评论(0) 推荐(0)

身份证号15 18位转换
摘要:1 import java.util.regex.*; 2 /** 3 * 中国大陆的身份证检验算法,以及15位和18位身份证的相互转换。 4 * @author hutz 5 * 6 */ 7 public class IdCardUtil { 8 9 public IdCardUtil(){10 11 }12 13 /**14 * 15位身份证号码转化为18位的身份证。如果是18位的身份证则直接返回,不作任何变化。15 * @param idCard,15位的有效身份证号码16 * @return idCard18 返回18位的有效... 阅读全文

posted @ 2013-06-14 11:10 lylyalong 阅读(1244) 评论(0) 推荐(0)

hibernate4 创建SessionFactory
摘要:1 private static SessionFactory sessionFactory; 2 private static ServiceRegistry serviceRegistry; 3 4 private static SessionFactory configureSessionFactory() throws HibernateException { 5 Configuration configuration = new Configuration(); 6 configuration.configure(); 7 serviceRegi... 阅读全文

posted @ 2013-06-14 11:09 lylyalong 阅读(91) 评论(0) 推荐(0)

导航