Content of Redis

by keen

Installation

Before we start using Redis in our Java programs, we need to make sure that we have Redis java Driver and Java set up on the machine. You can check Java tutorial for Java installation on your machine. Now, let us check how to set up Redis java driver.

  • You need to download the jar from the path Download jedis.jar. Make sure to download latest release of it.
  • You need to include the jedis.jar into your classpath.

Connect to redis server

Now, let's compile and run above program to test the connection to redis server. You can change your path as per your requirement. We are assuming current version of jedis.jar is available in the current path

Redis Java String Example

Now, let's compile and run above program.

Redis Java List Example

Now, let's compile and run above program.

Redis Java Keys Example

Now, let's compile and run above program.