The Mongo JDBC Driver provides a very minimal implementation of the JDBC driver specification for MongoDB. You can think of MongoDB collections as "tables" and documents as "rows".

As of version 0.0.2, only "SELECT" statements are supported, and the only SELECT-able columns are :

  • "_id"
  • document
  • wildcard (*) - This is the equivalent to 'select "_id", document from ...'

The "FROM" clause of the "SELECT" query should specify a single MongoDB collection (joins are not supported).

"WHERE" clauses are currently not supported.

The rows returned by a supported "SELECT" statement have at most two columns : the MongoDB ObjectId ("_id") of each document and the JSON document itself, represented as a CLOB (CLOB was chosen because relational databases typically limit VARCHAR type to well below 16MB - the maximum size of a MongoDB document in version 2.2).


In order to connect to a MongoDB instance, specify a JDBC URL with the following format:


The java.sql.Statement (retrieved by connection.createStatement()) is the only currently supported way to evaluate SQL as MongoDB primitive operations using this driver.