Update DatabaseHandler.java

Fixed missing/wrong closes - added more debug output