Reputation: 380
Recently I started working on mongodb and I have been using the mongodb java driver for database operations I also read about UnityJDBC - jdbc driver for mongodb. I know that UnityJDBC queries MongoDB with queries having SQL like syntax
What I dont understand - The difference between java driver for mongodb and jdbc driver for mongodb.
Edit : Can JDBC API be used for NoSQL Databases
Upvotes: 5
Views: 2690
Reputation: 602
MongoDB Java Driver is for MongoDB operations. You can do any MongoDB queries or Map-Reduce operations with this driver. MongoDB JDBC Driver is for SQL operations. So, you can query with SQL syntax on MongoDB. But, UnityJDBC Driver can't join tables(collections).
If you have to query MongoDB collections with SQL, you can use CitusDatas' MongoDB Foreign Data Wrapper. With this way, you can query on MongoDB with any PostgreSQL driver for any language such as Java, C# vs..
I have tried several ways to join collections with SQL and this way is the best on performance.
Upvotes: 2
Reputation: 3261
JDBC Connection is basically used to connect to server in remote machine. And normal java driver is used in a standalone system.You can not connect to a remote mongodb server using java driver.Hope this is what you need.Other wise let me know?
Upvotes: 2