Connecting to Model Manager Databases
You can connect to a Model Manager database, for example, by first saving an alias for the database using the Alias field in the Settings window and then using this alias as an identifier in the API.
Only databases that have already been added to the COMSOL Desktop are available from the API. For a Model Manager server database, you must also have selected the Remember Password check box — either when connecting to the server database via the Add Database window or from the Settings window for the corresponding database configuration.
Examples
Connect to the database with alias my-database.
DatabaseApi api = DatabaseApiUtil.api();
Database database = api.databaseByAlias("my-database");
Connect to databases by looping over all database configurations.
DatabaseApi api = DatabaseApiUtil.api();
 
QueryDatabaseConfigurationResultStream configurations = api
  .queryDatabaseConfigurations();
 
for (QueryDatabaseConfigurationResult config: configurations) {
  DatabaseConfigurationKey configurationKey = config
    .databaseConfigurationKey();
  Database database = api
    .databaseByConfigurationKey(configurationKey)
}
An exception is thrown if Model Manager is unable to connect to the database. This includes, for example, if the password used to login to a Model Manager server is not available for Model Manager.