上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页
摘要: /*异常:是什么?是对问题的描述。将问题进行对象的封装。------------异常体系: Throwable |--Error |--Exception |--RuntimeException异常体系的特点:异常体系中的所有类以及建立的对象都具备可抛性。 也就是说可以被throw和throws关键字所操作。 只有异常体系具备这个特点。--------------throw和throws的用法:throw定义在函数内,用于抛出异常对象。throws定义在函数上,用于抛出异常类,可... 阅读全文
posted @ 2013-04-06 23:14 谷文仁 阅读(101) 评论(0) 推荐(0) 编辑
摘要: /*异常:就是程序在运行时出现不正常情况。异常由来:问题也是现实生活中一个具体的事物,也可以通过java的类的形式进行描述。并封装成对象。 其实就是java对不正常情况进行描述后的对象体现。对于问题的划分:两种:一种是严重的问题,一种非严重的问题。对于严重的,java通过Error类进行描述。 对于Error一般不编写针对性的代码对其进行处理。对与非严重的,java通过Exception类进行描述。 对于Exception可以使用针对性的处理方式进行处理。无论Error或者Exception都具有一些共性内容。比如:不正常情况的信息,引发原因等。Throwab... 阅读全文
posted @ 2013-04-06 23:11 谷文仁 阅读(138) 评论(0) 推荐(0) 编辑
摘要: /*private :私有,权限修饰符:用于修饰类中的成员(成员变量,成员函数)。私有只在本类中有效。将age私有化以后,类以外即使建立了对象也不能直接访问。但是人应该有年龄,就需要在Person类中提供对应访问age的方式。注意:私有仅仅是封装的一种表现形式。之所以对外提供访问方式,就因为可以在访问方式中加入逻辑判断等语句。对访问的数据进行操作。提高代码健壮性。*/class Person{ private int age; public void setAge(int a) { if(a>0 && a<130) { age... 阅读全文
posted @ 2013-04-06 23:10 谷文仁 阅读(165) 评论(0) 推荐(0) 编辑
摘要: package com.guwenren.service.base;import java.beans.Introspector;import java.beans.PropertyDescriptor;import java.io.Serializable;import java.lang.r... 阅读全文
posted @ 2013-04-02 10:01 谷文仁 阅读(610) 评论(0) 推荐(0) 编辑
摘要: package com.guwenren.service.base;import java.io.Serializable;import java.util.LinkedHashMap;import com.guwenren.bean.QueryResult;/** * 数据库通用dao * @... 阅读全文
posted @ 2013-04-02 10:00 谷文仁 阅读(425) 评论(0) 推荐(0) 编辑
摘要: <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration> <session-factory 阅读全文
posted @ 2013-04-02 09:56 谷文仁 阅读(99) 评论(0) 推荐(0) 编辑
摘要: package com.guwenren.bean;import java.util.List;/** * 查询数据集 * * @author guwenren * * @param <T> */public class QueryResult<T> { /* 数据集 */ private List<T> resultlist; /* 总记录数 */ private Long totalrecord; public List<T> getResultlist() { return resultlist; } public void s... 阅读全文
posted @ 2013-04-02 09:54 谷文仁 阅读(323) 评论(0) 推荐(0) 编辑
摘要: package com.guwenren.bean;import java.util.List;/** * 分页总类 * @author guwenren * * @param <T> */public class PageView<T> { /** 分页数据 **/ private List<T> records; /** 页码开始索引和结束索引 **/ private PageIndex pageindex; /** 总页数 **/ private long totalpage = 1; /** 每页显示记录数 **/ private int... 阅读全文
posted @ 2013-04-02 09:53 谷文仁 阅读(326) 评论(0) 推荐(0) 编辑
摘要: package com.guwenren.bean;/** * 分页页码计算类 * @author guwenren * */public class PageIndex { private long startindex; private long endindex; public PageIndex(long startindex, long endindex) { this.startindex = startindex; this.endindex = endindex; } public long getStartindex(... 阅读全文
posted @ 2013-04-02 09:51 谷文仁 阅读(346) 评论(0) 推荐(0) 编辑
摘要: package com.guwenren.utils;import java.util.HashMap;import java.util.Map;import java.util.regex.Pattern;import javax.servlet.http.Cookie;import java... 阅读全文
posted @ 2013-04-02 09:48 谷文仁 阅读(1130) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页