Database Update API
The Database Update API provides developers with the ability to create an update solution for their applications that does not require any user interaction. The API allows a developer to create a program that takes a source database, new data dictionary, and destination for the new data files, and builds and starts an online copy job that copies the contents of the existing database into data files that match the definition of the new dictionary.
In some cases it may be desirable to perform the update process interactively using a graphical user interface and so these features are also available in the Enterprise Manager. Please See “Database Update Wizard” for complete details.
The bulk of the documentation necessary to fully use the database update API are in the Javadoc format and can be found at:
The best place to start in the API documentation is with the following classes:
com.basis.api.admin.BBjAdminBase
com.basis.api.admin.BBjAdminDatabase
com.basis.api.admin.BBjAdminDictionaryMigrationInfo
Example
The following example shows how to start a simple database update process. Use the API documentation links above to acquire information about performing additional processing of the information before starting the update:
use com.basis.api.admin.BBjAdminFactory use java.net.InetAddress declare com.basis.api.admin.BBjAdminBase adminBase! declare com.basis.api.admin.BBjAdminList adminList! declare com.basis.api.admin.BBjAdminDatabase db! declare com.basis.api.admin.BBjAdminDictionaryMigrationInfo info! dbserver$ = "localhost" dbport = 2002 dbssl = 0 user$ = "admin" password$ = "admin123" REM Get access to the BBjAdminBase instance used as the start for the API adminBase! = BBjAdminFactory.getBBjAdmin( : InetAddress.getByName(dbserver$), : dbport, : dbssl, : user$, : password$) REM Get the database that we will use for the update process. db! = adminBase!.getDatabase("ChileCompany") REM Specify the location of the new dictionary and the destination REM for the data files. The returned object will contain all the REM info to perform an update job. It will contain all of the missing REM database items, so you will probably want to clear that out or REM remove items you do not want migrated. info! = db!.getDictionaryMigrationInfo( : "C:\databases\chiledd-new\bbdict", : "C:\databases\chiledd-new\data") REM Start the update process db!.updateDatabase(info!) |