Skip to content

Instantly share code, notes, and snippets.

@guyroyse
Created March 11, 2020 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guyroyse/3bd78ad5d06a870fe1281dee81fcd7ba to your computer and use it in GitHub Desktop.
Save guyroyse/3bd78ad5d06a870fe1281dee81fcd7ba to your computer and use it in GitHub Desktop.
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