文件名称:jedis调用redis源码Demo
文件大小:7.53MB
文件格式:ZIP
更新时间:2019-02-04 03:26:25
jedis redis 源码 Demo
jedis调用redis源码Demo,直接导入工程就可以运行。 redis目录下有redis安装文件和入门电子书 redis64-2.8.9.zip redisbin_x32.zip Redis入门指南(JB51.NET).pdf Redis设计与实现.pdf src: FirestJedisTest.java JedisClusterTest.java RedisClient.java RedisShardPoolTest.java import redis.clients.jedis.Jedis; import redis.clients.jedis.exceptions.JedisConnectionException; public class FirestJedisTest { private static Jedis jedis = new Jedis("127.0.0.1"); public void testConn() { try { jedis.connect(); jedis.ping(); jedis.quit(); } catch (JedisConnectionException e) { e.printStackTrace(); } } public void setTest() { try { for (int i = 0; i < 100; i++) { jedis.set("key" + i, "value" + i); } } catch (Exception e) { e.printStackTrace(); } } public void setStrTest(String key, String value) { try { jedis.set(key, value); } catch (Exception e) { e.printStackTrace(); } } public void getTest() { try { for (int i = 0; i < 100; i++) { System.out.println(jedis.get("key" + i)); } } catch (Exception e) { e.printStackTrace(); } } public void delTest() { try { for (int i = 0; i < 100; i++) { System.out.println(jedis.del("key" + i)); } } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { FirestJedisTest client = new FirestJedisTest(); client.setTest(); client.getTest(); // client.delTest(); System.out.println(jedis.dbSize()); } }
【文件预览】:
jedisOptDemo
----bin()
--------RedisClient.class(16KB)
--------RedisShardPoolTest.class(3KB)
--------FirestJedisTest.class(2KB)
--------JedisClusterTest.class(391B)
----.settings()
--------org.eclipse.core.resources.prefs(57B)
--------org.eclipse.jdt.core.prefs(629B)
----src()
--------RedisShardPoolTest.java(2KB)
--------FirestJedisTest.java(2KB)
--------JedisClusterTest.java(1KB)
--------RedisClient.java(19KB)
----.project(388B)
----.classpath(355B)
----lib()
--------commons-pool-1.5.2.jar(94KB)
--------jedis-2.1.0.jar(136KB)
----redis()
--------Redis设计与实现.pdf(2.48MB)
--------redis64-2.8.9.zip(1.25MB)
--------redisbin_x32.zip(554KB)
--------Redis入门指南(JB51.NET).pdf(4.09MB)