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 -
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:
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.separatorfor 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.
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.