開啟eclipse
Create a Project: File -> New -> Project
create a Project name (ex. testNHIRD)
Give a name for Package (ex. mongoConnection)
Create Class
Give a name for Class (ex. JavaMongoDBConnection)
The screen look like the following picture
Use "add external archives" to add Java and MongoDB driver
Please see ADD EXTERNAL ARCHIVES
Then type codes as follows
You can also take Making A Connection from MongoDB tutorial website as a reference
Other useful websites
Java Tutorial of MongoDB
Java + MongoDB Hello World Example
No comments:
Post a Comment