我的DBDriver课堂上有两种方法open,close sqlite database如下所示。
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();
}
我在我的其他类中使用上述方法来打开和关闭sqlite database。
我想确定数据库是打开还是关闭。我怎么能这样做?