Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

In some scenarios the developer may have an existing database or an existing template to create a data database from. If not, a database needs to be created. One option is to have a blank template on the server and use that. For creating a database from a template there are pre-existing APIs in the Database class - Database.createCopy() and Database.createFromTemplate().

If not, ODA has added APIs to create a new database from an empty ODS 52 NSF that has minimal design elements and ACL settings. There are two new methods:

  1. Session.createBlankDatabase(folder, fileName) allows a new database to be created in the Data directory of the server / workstation running the code. The first parameter is the folder / folders to create the database in. Use File.separator for the relevant folder separator for the operating system. The second parameter is the filename without any folder prefix. If the filename is missing a ".nsf" suffix, that gets automatically appended. NOTE: This method cannot be used to create a .ntf file.
  2. Session.createBlankDatabaseAbsolutePath(folder, fileName) allows a new database to be created in a specific location, e.g. C:\Temp. This could also be used to create a database on a remote server, if network file access is available.

The APIs interact directly with the filesystem.

  • No labels