-
[Redis] 스프링부트 레디스 연동 (간단한 예제)개발/서버 2023. 7. 10. 00:09
의존성 추가
dependencies { implementation 'redis.clients:jedis:4.3.1' //... }
데이터 저장 및 조회
import org.junit.jupiter.api.Test; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPooled; public class TestMain { @Test public void test(){ JedisPooled jedisPooled = new JedisPooled("localhost", 6379); jedisPooled.set("foo", "bar"); System.out.println(jedisPooled.get("foo")); } }
'개발 > 서버' 카테고리의 다른 글
[Redis] 우분투에서 레디스 설치하기 (0) 2023.07.09