diff --git a/ArkDataKit/entry/src/main/ets/pages/LocalDatabaseReader.ets b/ArkDataKit/entry/src/main/ets/pages/LocalDatabaseReader.ets index e353259da1fae8517dfbcebbbdb01c6c28ea0b8c..efd17032ac68f6dabae0e36bc4e207092d861e70 100644 --- a/ArkDataKit/entry/src/main/ets/pages/LocalDatabaseReader.ets +++ b/ArkDataKit/entry/src/main/ets/pages/LocalDatabaseReader.ets @@ -23,14 +23,14 @@ import { relationalStore } from '@kit.ArkData'; import { common } from '@kit.AbilityKit'; import { BusinessError } from '@kit.BasicServicesKit'; -// 工具类中:在EntryAbility中获取Context后保存至AppStorage,然后在工具类中使用AppStorage获取 +// Obtaining the Context in EntryAbility, save it to AppStorage, then use AppStorage to retrieve it in the utility class let context = AppStorage.get('context') as UIContext; let UiAbilityContent = context.getHostContext() as common.UIAbilityContext; let RDBDirectory = UiAbilityContent.databaseDir; let resource = UiAbilityContent.resourceManager; function initDatabase() { - // 创建数据库沙箱目录 + // Create a database sandbox directory try { let dirPath = RDBDirectory + '/entry'; fileIo.mkdirSync(dirPath); @@ -40,10 +40,10 @@ function initDatabase() { console.error(`mkdir rdbPath failed, error code: ${error.code}, message: ${error.message}.`); } - //数据库名称 + // Set db name let dbName: string = 'Objective.db'; - //读取rawfile目录下db文件 + // Read the db file in the rawfile directory try { let content = resource.getRawFileContentSync(dbName); let cFile = RDBDirectory + '/entry/rdb/' + dbName;