Previous article: Http://www.cnblogs.com/hoojo/archive/2011/06/01/2066426.html introduced to the MONGODB console to complete the data manipulation of MongoDB, We have a comprehensive understanding and understanding of MongoDB through the previous article. Now we're going to use Java to manipulate
MongoDB official Java driver, save and read, the need is DBObject object, this is an interface, implement Put,get and other methods, similar to map, if we want to directly save ordinary Java objects to MongoDB, You need to convert to dbobject objects, or directly implement the DBObject interface, which is very complex
Tags: mongodb Java database Web development"MongoDB for Java" Java Operation MongoDBDevelopment of products in order to finance, constantly revised, from the first version to now the latest version, and finally found that the company's development direction has changed, the
Use java to operate MongoDB and java to operate mongodb
1. Prepare the environment
Download the driver packages supported by mongoDB for Java
Driver Pack: https://github.com/mongodb/mon
In the previous article, we talked about MongoDB's command to get started, this blog will be based on the previous blog created database and table completed a simple Java MongoDB CRUD Example, using Java to connect MongoDB database. and implement routines such as creating a database, getting a table, traversing objects
This article mainly introduces Java operation MongoDB.
Development environment:
System:windows
Ide:eclipse, MyEclipse 8
Database:mongodb
To develop a dependent library:
JavaEE5, Mongo-2.5.3.jar, Junit-4.8.2.jar
First, preparatory work
1, first of all, download the MongoDB Java-supported driver package
Driver p
Original address: http://blog.csdn.net/drifterj/article/details/7948090Directory Address: HTTP://BLOG.CSDN.NET/DRIFTERJ/ARTICLE/CATEGORY/1191327/2In the front we all manipulate the data accessing MongoDB through the shell, the language used in the shell is JavaScript. Let's talk about how to access the MongoDB database through Java.The Java driver is the earliest
MongoDB official Java driver, save and read, the need is DBObject object, this is an interface, implementation put,get and other methods, similar to map, if we want to directly save ordinary Java objects to MongoDB, It needs to be converted into DBObject object first, or implement DBObject interface directly, it is qui
Speaking of Java operations on databases, we will naturally think of Sun's well-known brand JDBC. For NoSQL databases such as MongoDB, there are currently no standards such as JDBC. This article analyzes the current situation and looks forward to www.
Speaking of Java operations on databases, we will naturally think of Sun's well-known brand JDBC. For NoSQL datab
to ensure that different hosts generate different machine hash values, to ensure that there is no conflict in the distribution, This is why the strings in the middle of the objectid generated by the same machine are identical. 3) PIDThe process ID. The machine above is to ensure that the objectid generated in different machines do not conflict, and the PID is to be in the same machine different MongoDB process generated objectid conflict, the next "a
Related Materials
1. MongoDB for Java driver package
Https://github.com/mongodb/mongo-java-driver/downloads
2,Online document
Http://www.mongodb.org/display/DOCS/Java+Language+Center
Operation
1. query all data in a table (called a set in
In the previous article we talked about MongoDB's command to get started, this blog will be based on the database and table established in the previous blog to complete a simple Java MongoDB CRUD Example, the use of Java to connect MongoDB database, and the implementation of database creation, get the table, Routines s
MongoDB supports multiple languages and is driven by multiple languages.
Java MongoDB operations to achieve curd: premise: Download the corresponding driver: download on the official website: http://central.maven.org/maven2/org/mongodb/mongo-java-driver/ I use mongo-2.10.1.j
MongoDB Java driver is thread-safe, for general applications, as long as a MONGO instance, MONGO has a built-in connection pool (pool size defaults to 10).
The following code gives you an introduction to the Java-driven operations of MongoDB, as shown in the following code:
Import java.util.ArrayList;
Import java
The content of the Pom.xml in HelloWorld's MAVEN project is
But what if you want to refer to a third party's library development? This article discusses this issue, taking MongoDB as an example, here does not introduce MongoDB, only know that he is a nosql, and there are client and server,
We will refer to MongoDB Library to realize
Tags: index tracking filter Demo next set URI haha OData Depending on the version number, the API may also be different. This study uses the 3.0 version number. 1. The JDBC driver version number used for MongoDB is: Mongo-java-driver-3.0.0.jar 2. This section simply introduces JDBC operations and does not consider efficiency issues on a temporary basis. 3, the package of tool class code such as the followin
On the blog about MongoDB processing large file ideas and processes, let's look at how the Java driver to implement file operations. The Java driver provided by MongoDB encapsulates specific implementation details, and we are very simple to operate.
Add, delete, and read files by using a few components:
Gridfs: A core
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.