memcache与spring集成 实例
2012-08-07 10:35
295 查看
学习了memcache,这是个好东西,分享一下自己的小实例,也方便以后查找使用
一、前期准备
TestMemcache.java测试类 用的是junit4
一、前期准备
1) 下载memcached服务端memcached-1.2.6-win32-bin.zip,地址:http:
//code.jellycan.com/memcached/
TestMemcache.java测试类 用的是junit4
package com.pis.memcache; import org.junit.Before; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.danga.MemCached.MemCachedClient; public class TestMemcache { MemCachedClient memCachedClient; @Before public void beforeTest(){ ApplicationContext atx = new ClassPathXmlApplicationContext("/spring/spring-memcache.xml"); memCachedClient = (MemCachedClient)atx.getBean("memCachedClient"); } @Test public void TestMem(){ memCachedClient.set("name", "han"); System.out.println(memCachedClient.get("name")); } }
相关文章推荐
- memcache与spring集成 实例
- Spring集成Memcache实例
- memcache与spring集成 实例
- Memcache与Spring集成实例
- Spring集成XFire的WebService实例
- 8.6 Spring Boot集成 Spring Security 《Spring Boot开发:从0到1》 工程实例: LightSword
- spring集成memcache 示例一
- 低耦合的Struts集成Spring的实例
- Spring-3.2.4 + Quartz-2.2.0集成实例
- 低耦合的Struts集成Spring的实例
- spring boot集成rabbitmq的实例教程
- Mybatis集成Spring的实例代码_动力节点Java 学院整理
- SpringBoot 集成Kaptcha实现验证码功能实例详解
- Spring-3.2.4 + Quartz-2.2.0集成实例
- DWR高级主题之DWR与spring集成(使用springMVC,非注解的实例)
- spring集成memcache 示例二
- spring,springmvc,mybatits集成实例--后台分页查询
- Atomikos Jta分布式事务spring集成实例
- spring缓存集成memcache
- SpringBoot集成dubbo实例