Advertisement
ervinne

DataAccessObject

Apr 22nd, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. public class DataAccessObject {
  2.  
  3.     protected DataBaseSQLiteAdapter dbHelper;
  4.     protected SQLiteDatabase database; // or db if you want
  5.  
  6.     public DataAccessObject(Context context) {
  7.         dbHelper = new DataBaseSQLiteAdapter(context);
  8.     }
  9.  
  10.     /**
  11.      * Initializes the database of this data access object so it may be ready for queries
  12.      */
  13.     public void open() {
  14.         database = dbHelper.getWritableDatabase();
  15.     }
  16.  
  17.     public void close() {
  18.         database.close();
  19.     }
  20.    
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement