import org.junit.Test;
import redis.clients.jedis.Jedis;
public class testdb {
@Test
public void RedisTest(){
String key = "rds:task-test";
String val = "{'succeedDate': 1513152466.972549, 'taskUrl': ['
https://hws.m.taobao.com/cache/wdetail/5.0/?id=521458057351
'], 'headers': {}, 'proxy': 'True', 'taskName': 'hbase', 'saveSite': 'testAuctionHbase'}";
//Connecting to Redis server on localhost
Jedis jedis = new Jedis("
106.75.132.229
",6379);
jedis.auth("zxasqw123");
jedis.select(15);
System.out.println("Connection to server sucessfully");
//store data in redis list
jedis.lpush(key, val);
jedis.lpush(key, val);
jedis.lpush(key, val);
//check whether server is running or not
// System.out.println("Server is running: "+jedis.get("abc"));
}
}
import redis.clients.jedis.Jedis;
public class testdb {
@Test
public void RedisTest(){
String key = "rds:task-test";
String val = "{'succeedDate': 1513152466.972549, 'taskUrl': ['
'], 'headers': {}, 'proxy': 'True', 'taskName': 'hbase', 'saveSite': 'testAuctionHbase'}";
//Connecting to Redis server on localhost
Jedis jedis = new Jedis("
",6379);
jedis.auth("zxasqw123");
jedis.select(15);
System.out.println("Connection to server sucessfully");
//store data in redis list
jedis.lpush(key, val);
jedis.lpush(key, val);
jedis.lpush(key, val);
//check whether server is running or not
// System.out.println("Server is running: "+jedis.get("abc"));
}
}