added javadocs to Database.java