Tutorial by Examples

The Jedis library is generally added to Java project using a dependency management system built into the build environment of the project. Two popular Java build systems are Maven and Gradle. Using Gradle To add the Jedis library to a Gradle project, you will need configure a repository and add a...
Using a Pool Most code will want to connect to Redis using a pool of shared connection objects. Connecting to Redis using a pool involves two different code block. At initialization time, your application needs to create the connection pool: JedisPoolConfig poolCfg = new JedisPoolConfig(); ...
Once you have established a connection to Redis you can get and set values using the Jedis connection object: Get String value = jedis.get(myKey); Set jedis.put(myKey, "some value");
To execute a Redis command using Jedis, you make method calls against the Jedis object you created from the pool. Jedis exposes Redis commands as method calls, some example are: - String get(String key) - Long geoadd(String key, double longitude, double latitude, String member) - List<String...

Page 1 of 1