add javadoc and Database constructor