Introduction
Hint
This article is generated by AI translation.
jdbc-mongo is a MongoDB JDBC adapter that lets developers operate MongoDB via standard JDBC interfaces and MongoDB commands. The goal is to let you use MongoDB seamlessly with the familiar JDBC programming model.
Core Features
- JDBC compatible: implements standard JDBC interfaces and integrates with any JDBC-capable framework.
- Rich command set: supports common MongoDB commands including Collections, Database, Index, and User.
- Supports command placeholders
?withPreparedStatementfor bind arguments. - Supports multiple commands executed together and retrieving multiple results via standard JDBC methods.
- Supports
Statementproperties:maxRows,fetchSize,timeoutSec. - Supports
Statement.RETURN_GENERATED_KEYS, automatically returning the generated_idon insert. - Supports interceptors for logging, performance monitoring, etc.
- Supports type conversion; e.g., a
LONGresult can be read viaResultSet.getIntorgetString. - Supports
BLOB,CLOB,NCLOBreads.
Architecture
Internally uses the official MongoDB driver for communication, ANTLR4 to parse commands, and converts them to MongoDB BSON operations.
Use Cases
- Need unified (JDBC) access to MongoDB in Java projects.
- Prefer to use the original command syntax for MongoDB.
- Need to integrate MongoDB into existing JDBC-based data processing flows.