Introduction
jdbc-redis is an independent JDBC driver. Access Redis strings, hashes, lists, sets and sorted sets using native commands. Use Connection, PreparedStatement and ResultSet directly; dbVisitor APIs are optional.
Features
- Use common String, Hash, List, Set and Sorted Set commands.
- Bind command parameters through PreparedStatement and read responses as result sets or update counts.
- Connect to standalone Redis or Redis Cluster and configure authentication, timeouts and cluster pooling.
Metadata Queries
Query through connection.getMetaData():
| JDBC method | Result |
|---|---|
getCatalogs() | The selected database number, such as 0 |
getTables() | Empty result; keys are not tables |
getColumns() | Empty result |
getSchemas() | Empty result |
getTableTypes() | Empty result |
After a successful database change, getCatalogs() returns the new database number. It does not enumerate all configured databases.
Get Connected
- Add dependencies: Maven or Gradle configuration.
- Connect to the database: JDBC URL, credentials and connection examples.
- Configure parameters: names, defaults and units.
- Usage limitations: JDBC support and database-specific restrictions.
Before You Connect
- Commands must use the syntax supported by this driver; arbitrary relational SQL is not translated.
- JDBC batch and transactions are not supported. Check the shared JDBC limitations before integrating a connection pool, ORM or other JDBC tool.
- The JDBC URL prefix is
jdbc:dbvisitor:jedis://, notredis://.