public void consumeDatabase ( DbConsumer dbConsumer ) { SQLiteDatabase db = getDatabaseConnection ( ) ; try { dbConsumer . consume ( db ) ; } finally { reduceDatabaseConnection ( ) ; } }
Execute an action on the database . The opening and closing of the database connection is handled for you .