Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 1.33 KB

README.md

File metadata and controls

35 lines (29 loc) · 1.33 KB

Handling MySQL and MongoDB databases with Java

Basic data handling with Java, MySQL and MongoDB

Libraries needed:

MySQL

Given a database, this program is able to create a table pet if pet doesn't already exist.

mysql> describe pet;

Field Type Null Key Default Extra
name varchar(20) YES NULL
owner varchar(20) YES NULL
species varchar(20) YES NULL
sex char(1) YES NULL

Other features of the program:

  • Show all rows in the table.
  • Insert new row.
  • Delete a row given parameters (key, value).
    • DELETE FROM pet WHERE key=value

MongoDB

Compared to MySQL, MongoDB is more flexible regarding handling data.

Given a database test, the program is able to:

  • See all collections inside test.
  • Read all documents inside one collection.
  • Create a new collection.
  • Insert documents into a collection.
  • Remove a document from a collection.
  • Drop an entire collection.