added database contract, added JUnit test to test database.