摘要:打jar包: 选择要打包的文件: javac -d . Hello.java .代表打包的目标路径 jar cvf test.jar com //test是打包名称,com是打包的文件夹 修改test.jar的Manifest,加上Main-Class: com.donghua.test.Hello
阅读全文
摘要:applicationContext.xml配置 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.or
阅读全文
摘要:1.家jar包 2配置applicationContext与xxx.hbm.xml(根据需要决定是否配置hibernate.hbm.xml) applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="htt
阅读全文
摘要: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
阅读全文
摘要:配置applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.or
阅读全文
摘要:1.xml文件 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springf
阅读全文
摘要:1 用于实现代理。静态代理 如果不用InvocationHandler接口实现代理的话,我们写代码是这样的: 定义一个接口: interface Greet { void sayHello(String name); void goodBye(); } 实现这个接口: class GreetImpl
阅读全文
摘要:@Component @Controller @Service @Repository 四大注解作用基本一样,只是表象在不同层面 @Resource @Scope Struts2与Spring整合:1,添加Struts2的环境(jar包与配置文件)。2,添加Spring的环境(jar包与配置文件)。
阅读全文
摘要:1.定义自己的过滤器,Myfilter 实现Filter接口 public class MyFilter implements Filter { FilterConfig filterConfig = null; public void init(FilterConfig filterConfig)
阅读全文
摘要:jar包 建立数据库 数据源: package com.dataSource.c3p0;import java.beans.PropertyVetoException;import java.io.IOException;import java.sql.Connection;import java.
阅读全文
摘要:1 log4j has three main components: loggers: Responsible for capturing logging information. appenders: Responsible for publishing logging information t
阅读全文
摘要:首先进入cmd 切入MySQL的安装目录,然后切入 bin 目录 ,输入mysqld -n t --skip-grant-tables命令。 这个 cmd 窗口先不要关闭, 打开另一个窗口 登陆MySQL 或直接点开 MySQL Command Line Client 输入正确的密码, 就OK了!
阅读全文
摘要:Map接口主要实现类有HashMap,HashTable,TreeMap. 键要唯一,值可以一样,若是键一致,后面存入的会覆盖前面的。 HashMap,HashTable区别:HashMap可以键值都可以是null,线程是不同步的;而HashTable的键值都不可以为null,线程是同步的。 Has
阅读全文
摘要:class Father1{ static{ System.out.println("....static Father....."); } { System.out.println(".....父类非静态。。。"); } public Father1(){ System.out.println("
阅读全文
摘要:ArrayList 是List接口的实现类;底层的数据结构是数组,而LinkedList底层数据结构是双向循环链表。 所以在查询时ArrayList效率高,增删时LinkedList高。由于List中有索引,可以在指定位置插入。在iterator迭代器取元素时,在调用Arraylist中的itera
阅读全文
摘要:HashSet的底层数据结结构是哈希表,哈希表用于存储哈希值, hashSet中比较对象是否一样的是自动调用对象的hashCode和equals方法(hash值是操作系统给的,equals是Object继承的。自己也可以重写),当hash值相同时才调用equals,否则不要调用,只有当hashcod
阅读全文
摘要:TreeSet底层数据结构是二叉树 判断对象是否一致是通过是对象自身有比较的方法,即使类实现Comparable接口,重写compareTo方法,自己定义比较规则, 若是不想用元素本身的比较方法,又不想修改代码,那么可以使集合自身具有比较的方法,就是在集合初始化时实现Comparator接口,即Se
阅读全文