Skip to content
Snippets Groups Projects
Commit 2ab325e1 authored by Vito Conforti's avatar Vito Conforti
Browse files

added start 2 command

parent e0c1e2e2
No related branches found
No related tags found
No related merge requests found
......@@ -13,11 +13,11 @@ import redis.clients.jedis.Jedis;
public class Redis {
public static Jedis jedis;
public static Jedis jedis = new Jedis("localhost", 6379);
public static void main(String[] args) {
// create a Jedis client
jedis = new Jedis("localhost", 6379);
//jedis = new Jedis("localhost", 6379);
// perform Redis operations
......@@ -34,7 +34,11 @@ public class Redis {
public static String getValue(String key){
String val;
val = jedis.get(key); //"";
val = "";
if (jedis.exists(key)) {
val = jedis.get(key);
}
return val;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment