`
chinrui
  • 浏览: 94136 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论
文章列表
Spring IOC Annotation 进行Annotation-based Configuration配置 在beans.xml里面的beans标签里面加入下列的属性 xmlns:context="http://www.springframework.org/schema/context" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd 添加标签<context:annotation-co ...
Spring Note Spring Introdution 引入相关的包 ----spring-context-3.2.1.RELEASE.jar ----spring-beans-3.2.1.RELEASE.jar ----spring-core-3.2.1.RELEASE.jar ----spring-expression-3.2.1.RELEASE.jar ----commons-logging-1.1.2.jar UserDAOImpl类: package com.edu.hpu.impl; import com.edu.hpu.dao.UserDAO; import co ...
Spring dbcp 数据库连接池的配置 DataSource的配置与使用 第一步:引入相关的jar包 commons-dbcp-1.4.jar commons-pool-1.6.jar [b]在beans.xml里面对DataSource进行配置[/b] <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy ...
Spring DI Simulation 解释:IOC Inverse Of Control(控制反转) 或者 DI Dependency Injection(依赖注入) 观察以下代码,发现UserService类并没有对自己的属性UserDAO进行初始化,但是UserDAO仍然不为null,因为ClassPathXmlApplicationContext类初始化的时候,通过读取配置文件bean.xml将UserDAO对象注入到UserService对象里面。所以明面上没有对其进行初始化,使用配置文件初始化类对象,易于控制,不必修改类代码,可扩展性强。 User类 package com.edu ...
#include <iostream> #include <stdlib.h> using namespace std; typedef int Elemtype; struct TNode { Elemtype data; struct TNode *lChild, *rChild; }; typedef struct Head { TNode *root; } *Tree; //函数声明 Tree init(); TNode * initNode(); void displayDESC(T ...
动态代理(Dynamic Proxy) 一、切面编程(在方法前后加上一些逻辑,如下:在save(User user)方法前后加逻辑) 准备工作: public class UserDAOImpl { public void save(User user) { System.out.println("user saved!"); } } 1、实现方法一:直接 ...
使用Jdom进行简单的XML解析 1、引入相应的Jar包 jdom-2.0.4.jar 下载地址:http://www.jdom.org/downloads/index.html 2、准备一个简单的Xml文件 <?xml version="1.0" encoding="UTF-8"?> <prop> <property name="sSize" value="52"></property> <property name="cSize ...
字符串(C++) /* 最后一个线性存储结构 */ /* 功能: 初始化:生成一个任意长度的字符串 展示:显示字符串的值 复制:复制一个任意长度字符串的值到另外一个任意长度字符串 连接:将两个任意长度的字符串连接成一个新和字符串 比较:比较两个任意长度的字符串的大小 截取:在一个字符串上截取一个子串 插入:在一个字符串中插入另外一个任意长度的字符串 判断包含:判断一个主串是否包含另外一个子串 */ #include <iostream> #include <stdlib.h> #includ ...
循环队列(C++) /* ----------------------------自定义循环队列---------------------------------*/ /* function: * add value into the Queue * delete value from the Queue * count the number of in the Queue * judge the Queue is empty or not * judge the Queue is full or not */ #include <iostream ...
批量修改文件名,移动文件,删除空文件夹 1、有时候,当我们遇到一个文件夹里面,存在多个文件夹,而这些子文件夹里面又放着要排序的文件的时候,如果让我们自己去手动修改文件名会比较麻烦,特别是当文件较多的时候,这时我们就可以用程序自动批量修改,这只是个小应用,希望能够帮到有需要的人,比较简单。不过在使用前,请先做好备份哦!!! import java.io.File; import java.util.regex.Matcher; import java.util.regex.Pattern; public class TestModifyFileName { private s ...
/* 排序算法:冒泡,选择,插入,希尔,快速,归并,堆排序 */ #include <iostream> #include <stdlib.h> using namespace std; //声明函数 void displayArray(int[] , int); void swapValue(int[] , int ,int); void shellSort(int[] , int); void popperSort(int[] , int); void popperSort2(int[] , int); void chooseSort(in ...
队列(C++) /*---------------------- 简单队列的链式实现------------------------- */ /* 功能: 1、以一定数目的元素初始化一个队列 2、判断队列是否为空 3、按队列顺序展示队列元素值 4、删除一个队列结点 5、获得队列的第一个元素值 6、向队列中加入一个元素结点 */ #include <iostream> #include <stdlib.h> using namespace std; typedef int Elemtype; typedef struct Node { ...
#include <iostream> #include <stdlib.h> using namespace std; typedef int Elemtype; typedef struct Node { Node *lNext; Elemtype eData; } *LinkedStack; //函数声明 LinkedStack initNode(); void showStack(LinkedStack); void initStack(LinkedStack , int); int stackLength(Li ...
Hibernate 4.2里面的缓存 1、 hibernate 里面的缓存分成一级缓存与二级缓存与查询缓存 一级缓存:Session级别的缓存 二级缓存:SessionFactory级别的缓存 查询缓存 2、 一级缓存 @Test public void testCache() { Session s = sf.getCurrentSession(); s.beginTransaction(); Category c = (Category)s.load(Category.class, 1); System.out.println(c.getName()); Ca ...
Hibernate之1+N问题 1、 Category类 package com.edu.hpu; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity public class Category { private int id; private String name; @Id @GeneratedValue public int getId() { return id; ...
Global site tag (gtag.js) - Google Analytics