Created
March 11, 2020 23:07
-
-
Save guyroyse/3bd78ad5d06a870fe1281dee81fcd7ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.guyroyse.blogs.lettucevsjedis; | |
import redis.clients.jedis.Jedis; | |
public class JedisSetGet { | |
private static final String YOUR_CONNECTION_STRING = "redis://:foobared@yourserver:6379/0"; | |
public static void main(String[] args) { | |
Jedis jedis = new Jedis(YOUR_CONNECTION_STRING); | |
jedis.set("foo", "bar"); | |
String result = jedis.get("foo"); | |
jedis.close(); | |
System.out.println(result); // "bar" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment