02 2017 档案
MySQL 常见函数
摘要:1 group_concat([DISTINCT] 要连接的字段 [Order BY ASC/DESC 排序字段] [Separator '分隔符']) 阅读全文
posted @ 2017-02-28 16:10 夏末秋萍 阅读(110) 评论(0) 推荐(0)
jdbc,hibernate,mybatis调用存储过程
摘要:一,调用存储过程 1 jdbc 2 hibernate 3 mybatis 在映射文件中编写 select语句 调用存储过程 二,调用函数 1 jdbc 2 hibernate 3 mybatis 阅读全文
posted @ 2017-02-28 00:22 夏末秋萍 阅读(287) 评论(0) 推荐(0)
java,内部类
摘要:有成员内部类,静态内部类,匿名内部类,局部内部类 成员内部类 静态内部类 阅读全文
posted @ 2017-02-22 22:28 夏末秋萍 阅读(147) 评论(0) 推荐(0)
java,对象排序
摘要:Java对象排序有两种方法 一,在对象类中实现接口 comparable 二,编写比较器 实现comparator,对象类不需要实现comparable接口 阅读全文
posted @ 2017-02-22 21:28 夏末秋萍 阅读(5611) 评论(0) 推荐(0)
java,关键字static
摘要:static:静态的,可以声明 字段,方法,和代码块[称为静态代码块],这样在一个 这个类的实例将可以共享他们[共产社会主义好] 并且该类也可以直接使用它,无须实例化。和final一起使用时,被声明的字段为常量,必须初始化,且不能被修改,被声明的 方法不能被重写。 测试 阅读全文
posted @ 2017-02-21 23:45 夏末秋萍 阅读(197) 评论(0) 推荐(0)
freemarker,在springmvc中使用freemarker
摘要:一,引入jar包 二,编写 web.xml文件 三,配置 springmvc-servlet.xml 四,编写 controller类 五,编写 test.ftl文件 阅读全文
posted @ 2017-02-21 23:09 夏末秋萍 阅读(3789) 评论(0) 推荐(0)
freemarker,在servlet中使用freemarker
摘要:一,在项目中编写***.ftl文件 二,在servlet中使用freemarker 阅读全文
posted @ 2017-02-21 17:37 夏末秋萍 阅读(557) 评论(0) 推荐(0)
freemarker,一个基本的java操作
摘要:public static void main(String[] args) throws Exception { //得到模板 Configuration cfg=new Configuration(Configuration.VERSION_2_3_25); cfg.setDirectoryForTemplateLoading(new File... 阅读全文
posted @ 2017-02-21 17:19 夏末秋萍 阅读(310) 评论(0) 推荐(0)
freemarker,自定义指令
摘要:一,自定义指令 二,使用指令 阅读全文
posted @ 2017-02-21 17:14 夏末秋萍 阅读(639) 评论(0) 推荐(0)
freemarker,字符串常用函数
摘要:${"asddfdsd"?substring(3,5)} ${"abcd"?cap_first} ${"abcd"?uncap_first} ${"abcd say "?capitalize} ${"abcd"?ends_with("a")?c} ${"abcd"?starts_with("a")?c} ${"abcaad"?index_of("a")} ${"abcda"?l 阅读全文
posted @ 2017-02-21 17:04 夏末秋萍 阅读(11953) 评论(0) 推荐(0)
freemarker,数字,日期,布尔值常用的函数
摘要:${3.4?floor} ${3.4?ceiling} ${3.45?round} ${3.45?rtf} ${3.458?string("0.##")} ${3.42?string.percent} ${3.42?string.currency} ${date?string("yyyy-MM-dd")} ${date?date} ${date?time} ${date?datetime} $... 阅读全文
posted @ 2017-02-21 17:03 夏末秋萍 阅读(453) 评论(0) 推荐(0)
freemarker, 序列和哈希的常见函数
摘要:${seq1?first} ${seq1?last} ${seq1?seq_contains(6)?string} ${seq1?seq_index_of(6)} ${seq1?seq_last_index_of(6)} ${seq} ${seq1?size} ${seq} ${seq.name}--${seq.age} ${key} ... 阅读全文
posted @ 2017-02-21 17:01 夏末秋萍 阅读(868) 评论(0) 推荐(0)
freemarker,自定义函数
摘要:一自定义函数 二,使用自定义函数 阅读全文
posted @ 2017-02-21 16:59 夏末秋萍 阅读(2815) 评论(0) 推荐(0)
freemarker,读取多个文件夹下的文件
摘要:当***.ftl文件分布在多个文件夹下时,读取文件方法 一,绝对路径的方法 二,相对路径的方法 阅读全文
posted @ 2017-02-21 16:56 夏末秋萍 阅读(1556) 评论(0) 推荐(0)
freemarker,读取xml格式的数据
摘要:有是数据包存在xml文档中 这是2可以使用 NodeModel.parse("xml文件");来读取数据 阅读全文
posted @ 2017-02-21 16:45 夏末秋萍 阅读(3460) 评论(0) 推荐(0)
处理 null异常
摘要:${user.name} ${(use.group.nam)!"不存在"} 数值存在 数值不存在 阅读全文
posted @ 2017-02-20 17:43 夏末秋萍 阅读(230) 评论(0) 推荐(0)
自定义指令
摘要:我的第一个自定义指令 name ${name} --- ${age} ${num} 调用时 的内容 不服就干 阅读全文
posted @ 2017-02-20 17:40 夏末秋萍 阅读(120) 评论(0) 推荐(0)
freemarker 数据类型
摘要:freemarker模板支持的数据类型有: 标量:字符串,数字,布尔值,日期。 容器:哈希表,序列 子程序:方法和函数,自定义指令 阅读全文
posted @ 2017-02-20 17:38 夏末秋萍 阅读(265) 评论(0) 推荐(0)
freemarker 指令
摘要:常见有 声明指令,条件指令,switch指令,循环指令,包含指令,不转义指令,压缩指令,也可以自定义指令 阅读全文
posted @ 2017-02-20 17:29 夏末秋萍 阅读(158) 评论(0) 推荐(0)
ireport Designer
摘要:ireport Designer是一款可视化编辑XML文档的工具,设计出来的xml文件可被JasperReport使用。 在win中有两种版本 .exe版 和 免安装版本。 5.6.0版ireport Designer存在不兼容jdk8 问题, 可以修改 etc/ireport.conf文件 设置j 阅读全文
posted @ 2017-02-19 18:05 夏末秋萍 阅读(504) 评论(0) 推荐(0)
java reflect
摘要:对象有编译类型和运行类型 Person man=new Man(); 编译类型 Person 运行类型Man 获取Class实例的方法Class的实例就是类的字节码(一个类在虚拟机中只有一份字节码) 1,Class clazz1=Animal.class; 2, Class<Person>clazz 阅读全文
posted @ 2017-02-18 14:32 夏末秋萍 阅读(251) 评论(0) 推荐(0)
数据库的分页
摘要:一,MySQL 基本句式 select * from tableName where ... order by ... limit [n,]m; 就是查询从第n条数据后的m 条数据。n可由可无。 子查询的分页方式,提高查询速度 select * from tableName where id>= ( 阅读全文
posted @ 2017-02-17 16:12 夏末秋萍 阅读(114) 评论(0) 推荐(0)
java的 interface 可以有方法体
摘要:在interface 中的方法也可以有方法体 public interface InterfaceMethod { public static int ID=1;//默认为 final static 即常量 //public InterfaceMethod(){} public static voi 阅读全文
posted @ 2017-02-16 20:54 夏末秋萍 阅读(1139) 评论(0) 推荐(0)
存储过程,函数,触发器
摘要:一,存储过程 1,存储过程的优点: .能完成复杂的判断和运算。 .执行速度快,可以重复使用。 2,存储过程的创建和调用 create procedure 名称(可以有参数) begin 语句... end; (可以有多个 Begin-end) 调用存储过程 : call 存储过程名。 3,存储过程中 阅读全文
posted @ 2017-02-13 21:27 夏末秋萍 阅读(511) 评论(0) 推荐(0)
jpa 是啥
摘要:jpa :java持久层API是一个规范。实际上还是要用到持久化框架,好比jpa是接口,持久化框架是实现接口的类。操作数据时,调用jpa的方法,但是具体实现的可能是 Hibernate,mybatis之类的持久化框架。这样就使得程序移植性更高。 jpa用到jdk5的注解。学习jpa,主要要学 Jpa 阅读全文
posted @ 2017-02-12 16:48 夏末秋萍 阅读(219) 评论(0) 推荐(0)
hibernate 对象状态
摘要:可分为 持久化状态,托管状态,游离状态。 临时状态:对象既不在缓存中,也不与数据表中的数据对应 OID为null。 持久化状态: 对象既在缓存,也与数据表中的数据对应,OID 不为null。 游离状态: 之前存在缓存中,现在不在缓存中,由持久化对象转换来的 OID不为null。 阅读全文
posted @ 2017-02-12 16:38 夏末秋萍 阅读(122) 评论(0) 推荐(0)
hibernate 缓存
摘要:一,session缓存 默认的不可配置 二,SessionFactory缓存 分两种 1,hibernate自带的缓存不可配置,hibernate启动时加载的,cfg.xml文件就属于这种 2,可以配置hibernate缓存,外置缓存 需要缓存插件,如EHcache 步骤: 1,添加 相关的jar 阅读全文
posted @ 2017-02-12 15:07 夏末秋萍 阅读(127) 评论(0) 推荐(0)
Hibernate的检索
摘要:一,hibernate的检索策略 1,类级别的检索策略 默认 <class>的属性 lazy="ture" 懒加载 2,属性的检索策略 <set>的属性 lazy:懒加载; batch-size: 设定批量检索的数量; fetch: 抓取策略 ,select ,join.subselect. 默认为 阅读全文
posted @ 2017-02-12 14:36 夏末秋萍 阅读(110) 评论(0) 推荐(0)
hibernate 继承映射
摘要:hibernate的继承映射可以理解为Java 类之间的继承关系,hibernate有三种解决方案 一,subclass属性 比如Student类 继承Person类,添加: 在Person.hbm.xml文件中添加 1,<subclass name="com.m01.subclass.Studen 阅读全文
posted @ 2017-02-10 02:04 夏末秋萍 阅读(152) 评论(0) 推荐(0)
hibernate 多对多关联映射
摘要:多对多关联映射 需要添加一张数据表,用来关联 双方 一,单向多对多关联映射 1,在一端的bean类添加对方的属性 如 Category类 private Set<Item> items=new HashSet<Item>(); 2,修改该bean类对应的映射文件 Category.hbm.xml < 阅读全文
posted @ 2017-02-10 01:19 夏末秋萍 阅读(114) 评论(0) 推荐(0)
hibernate 一对一关联映射
摘要:一,按照外键映射 1,在两端添加对方的属性; Manager 类 :private Department department; Department类 :private Manager manager; 2,在任意一端的映射文件添加: .比如在 Department.hbm.xml中: <many 阅读全文
posted @ 2017-02-09 01:09 夏末秋萍 阅读(128) 评论(0) 推荐(0)
hibernate 一对多 单双向关联
摘要:一,单向 n对1关联 1,在n 端的bean类中加入属性 : private Customer customer; 2,在 n端的配置文件中配置: <many-to-one name="customer" class="com.m01.n21.Customer" column="CUSTOMER_I 阅读全文
posted @ 2017-02-08 22:27 夏末秋萍 阅读(161) 评论(0) 推荐(0)
hibernate配置文件
摘要:hibernate配置文件有两种形式: hibernate.properties 和hibernate.cfg.xml 内容主要有 1,配置连接数据库的基本信息 <property name="connection.username">root</property> <property name=" 阅读全文
posted @ 2017-02-07 17:06 夏末秋萍 阅读(193) 评论(0) 推荐(0)
spring整合struts2
摘要:一,WEB应用如何使用spring 1,额外jar包。 spring-web-4.0.0.RELEASE.jar,spring-webmvc-4.0.0.RELEASE.jar 2,在web.xml文件中配置监听器,当应用启动时创建IOC对象 <context-param> <param-name> 阅读全文
posted @ 2017-02-06 15:58 夏末秋萍 阅读(157) 评论(0) 推荐(0)
spring整合hiberna
该文被密码保护。
posted @ 2017-02-06 15:27 夏末秋萍 阅读(1) 评论(0) 推荐(0)