1
-> 좋아, 여기에 SD 카드에 Sq-lite 데이터베이스가있다.안드로이드의 외부 저장소에서 데이터베이스에 액세스하거나 엽니 다
(String DB_PATH = Environment.getExternalStorageDirectory().getPath().toString();)
-> 데이터베이스가
dbFile = new File(DB_PATH + DB_NAME);
if(dbFile.exists()== true)
{
//set text db exists
open_DB();
}
else
{
//set text db does not exist
return;
}
존재하는지 확인 - 내가 데이터베이스 파일의 존재를 확인할 수 디버깅>을.
데이터베이스를 열 때하지만 난 예외가
SQLiteDatabase checkDB = null;
try
{
dbFile = new File(DB_PATH + DB_NAME);
myDataBase = SQLiteDatabase.openOrCreateDatabase(dbFile, null);
//myDataBase = SQLiteDatabase.openDatabase(DB_PATH + DB_NAME, null, 0);
//also tried this
//set text bd opened
}
catch(SQLiteException e)
{
//set text bd unable open
return;
}
예외는 무엇입니까? –