title: Check sqlite database is open or closed in android
body: <p>I have two methods in my <code>DBDriver</code> class to <code>open</code> and <code>close</code> <code>sqlite database</code> as below.</p>
  
  <pre><code>private SQLiteDatabase database;
  
  /**
       * Open Database to read and write.
       * 
       * @throws SQLException
       */
      public void open() throws SQLException {
          database = dbHelper.getWritableDatabase();
  
      }
  
      /**
       * Close opened database.
       */
      public void close() {
          dbHelper.close();
      }
  </code></pre>
  
  <p>I'm using above methods in my other class to open and close <code>sqlite database</code>.</p>
  
  <p>I want to identify database is open or closed. How could I do this?</p>