new api for Database.java