Skip to main content

11.1 JDBC Redis

Hint

This article is generated by AI translation.

jdbc-redis is a Redis JDBC adapter that lets developers operate Redis via standard JDBC interfaces and Redis commands. The goal is to use Redis seamlessly through the familiar JDBC programming model.

Core Features

  • JDBC compatible: implements standard JDBC interfaces and integrates with any JDBC-capable framework.
  • Supports 140+ common commands across DB, Server, Keys, List, Set, StoreSet, String, and Hash.
  • Supports command placeholders ? with PreparedStatement for bind arguments.
  • Supports executing multiple commands and retrieving multiple results via standard JDBC methods.
  • Supports Statement properties: maxRows, fetchSize, timeoutSec.
  • Supports interceptors for logging, performance monitoring, etc.
  • Supports type conversion; e.g., a LONG result can be read via ResultSet.getInt or getString.
  • Supports BLOB, CLOB, NCLOB reads.

Architecture

Internally uses the official Redis driver for communication, parses commands with ANTLR4, and translates them to Redis API calls.

Use Cases

  • Need unified (JDBC) access to Redis in Java projects.
  • Prefer to use original Redis command syntax.
  • Need to integrate Redis into existing JDBC-based data processing flows.