File tree 2 files changed +39
-0
lines changed
2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org .jee .redis ;
2
+
3
+ import redis .clients .jedis .Jedis ;
4
+
5
+ /**
6
+ * Created by bysocket on 16/3/25.
7
+ */
8
+ public class RedisPing {
9
+ public static Jedis jedis ;
10
+ public static void main (String [] args ) {
11
+ pingRedis ();
12
+ }
13
+
14
+ public static void pingRedis (){
15
+ jedis = new Jedis ("localhost" );
16
+ System .out .println ("Server is running: " + jedis .ping ());
17
+ }
18
+ }
Original file line number Diff line number Diff line change
1
+ package org .jee .redis ;
2
+
3
+ /**
4
+ * Created by bysocket on 16/3/25.
5
+ */
6
+ public class RedisString {
7
+ public static void main (String [] args ) {
8
+ setGetString ();
9
+ }
10
+
11
+ public static void setGetString () {
12
+ RedisPing .pingRedis ();
13
+
14
+ // set redis string
15
+ RedisPing .jedis .set ("name" ,"bysocket" );
16
+
17
+ // get redis string
18
+ System .out .println (RedisPing .jedis .get ("name" ));
19
+
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments