随笔分类 -  Java

上一页 1 2 3 4 5

jar 包和批量处理
摘要:打jar包: 选择要打包的文件: javac -d . Hello.java .代表打包的目标路径 jar cvf test.jar com //test是打包名称,com是打包的文件夹 修改test.jar的Manifest,加上Main-Class: com.donghua.test.Hello 阅读全文

posted @ 2015-08-24 19:59 卖肾割阑尾 阅读(371) 评论(0) 推荐(0)

解决No Hibernate Session bound to thread, and configuration does not allow creat。。。
摘要:applicationContext.xml配置 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.or 阅读全文

posted @ 2015-08-13 12:56 卖肾割阑尾 阅读(446) 评论(0) 推荐(0)

Spring—Hibernate
摘要:1.家jar包 2配置applicationContext与xxx.hbm.xml(根据需要决定是否配置hibernate.hbm.xml) applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="htt 阅读全文

posted @ 2015-08-11 12:54 卖肾割阑尾 阅读(107) 评论(0) 推荐(0)

事物管理
摘要:jdbc事务管理xml配置 <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSc 阅读全文

posted @ 2015-08-09 16:50 卖肾割阑尾 阅读(126) 评论(0) 推荐(0)

Spring_database_Template
摘要:配置applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.or 阅读全文

posted @ 2015-08-09 15:39 卖肾割阑尾 阅读(217) 评论(0) 推荐(0)

AOP annotation
摘要:1.xml文件 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springf 阅读全文

posted @ 2015-08-09 11:59 卖肾割阑尾 阅读(183) 评论(0) 推荐(0)

代理模式
摘要:1 用于实现代理。静态代理 如果不用InvocationHandler接口实现代理的话,我们写代码是这样的: 定义一个接口: interface Greet { void sayHello(String name); void goodBye(); } 实现这个接口: class GreetImpl 阅读全文

posted @ 2015-08-08 21:51 卖肾割阑尾 阅读(126) 评论(0) 推荐(0)

Spring注解与Spring与Struts2整合
摘要:@Component @Controller @Service @Repository 四大注解作用基本一样,只是表象在不同层面 @Resource @Scope Struts2与Spring整合:1,添加Struts2的环境(jar包与配置文件)。2,添加Spring的环境(jar包与配置文件)。 阅读全文

posted @ 2015-08-06 17:19 卖肾割阑尾 阅读(198) 评论(0) 推荐(0)

Filter
摘要:1.定义自己的过滤器,Myfilter 实现Filter接口 public class MyFilter implements Filter { FilterConfig filterConfig = null; public void init(FilterConfig filterConfig) 阅读全文

posted @ 2015-08-05 10:33 卖肾割阑尾 阅读(125) 评论(0) 推荐(0)

C3p0实践
摘要:jar包 建立数据库 数据源: package com.dataSource.c3p0;import java.beans.PropertyVetoException;import java.io.IOException;import java.sql.Connection;import java. 阅读全文

posted @ 2015-07-30 12:03 卖肾割阑尾 阅读(229) 评论(0) 推荐(0)

log4j
摘要:1 log4j has three main components: loggers: Responsible for capturing logging information. appenders: Responsible for publishing logging information t 阅读全文

posted @ 2015-07-29 15:26 卖肾割阑尾 阅读(166) 评论(0) 推荐(0)

解决MySQL 一闪而过的情况
摘要:首先进入cmd 切入MySQL的安装目录,然后切入 bin 目录 ,输入mysqld -n t --skip-grant-tables命令。 这个 cmd 窗口先不要关闭, 打开另一个窗口 登陆MySQL 或直接点开 MySQL Command Line Client 输入正确的密码, 就OK了! 阅读全文

posted @ 2015-07-24 22:40 卖肾割阑尾 阅读(1016) 评论(0) 推荐(0)

Map集合
摘要:Map接口主要实现类有HashMap,HashTable,TreeMap. 键要唯一,值可以一样,若是键一致,后面存入的会覆盖前面的。 HashMap,HashTable区别:HashMap可以键值都可以是null,线程是不同步的;而HashTable的键值都不可以为null,线程是同步的。 Has 阅读全文

posted @ 2015-06-22 13:18 卖肾割阑尾 阅读(142) 评论(0) 推荐(0)

代码块执行顺序。
摘要:class Father1{ static{ System.out.println("....static Father....."); } { System.out.println(".....父类非静态。。。"); } public Father1(){ System.out.println(" 阅读全文

posted @ 2015-06-19 20:47 卖肾割阑尾 阅读(238) 评论(0) 推荐(0)

ArrayList-VS-LinkedList
摘要:ArrayList 是List接口的实现类;底层的数据结构是数组,而LinkedList底层数据结构是双向循环链表。 所以在查询时ArrayList效率高,增删时LinkedList高。由于List中有索引,可以在指定位置插入。在iterator迭代器取元素时,在调用Arraylist中的itera 阅读全文

posted @ 2015-06-19 13:17 卖肾割阑尾 阅读(139) 评论(0) 推荐(0)

HashSet
摘要:HashSet的底层数据结结构是哈希表,哈希表用于存储哈希值, hashSet中比较对象是否一样的是自动调用对象的hashCode和equals方法(hash值是操作系统给的,equals是Object继承的。自己也可以重写),当hash值相同时才调用equals,否则不要调用,只有当hashcod 阅读全文

posted @ 2015-06-19 11:15 卖肾割阑尾 阅读(163) 评论(0) 推荐(0)

TreeSet两种比较
摘要:TreeSet底层数据结构是二叉树 判断对象是否一致是通过是对象自身有比较的方法,即使类实现Comparable接口,重写compareTo方法,自己定义比较规则, 若是不想用元素本身的比较方法,又不想修改代码,那么可以使集合自身具有比较的方法,就是在集合初始化时实现Comparator接口,即Se 阅读全文

posted @ 2015-06-19 10:49 卖肾割阑尾 阅读(136) 评论(0) 推荐(0)

上一页 1 2 3 4 5

导航