You can choose to have databases created dynamically like SQL Server and PostgreSQL, but because Db2 database creation can be very slow, we recommended that you create them ahead of time using SQL scripts.
dbfhadmin -script -type:datastore -provider:db2 -name:<datastore-name> -file:<script-name.sql> [-existdb:<db-name>|-db:<db-name>]
where <datastore-name> must be 8 characters or less, which is a Db2 restriction (note, this should be a database name that you have already specified when updating the configuration file), and where <script-name.sql> is the name of the script file to be created.
Additionally, there are two (mutually exclusive) optional parameters that you can specify: if you are creating the datastore to be within an existing Db2 database (for example, you may have one database that holds multiple datastores), use the -existdb option; if you are creating a new Db2 database for the datastore, use the -db option to specify the name of the database; if you omit both options, a new database with a default name will be created - the default name is the value given for the -name option.
Once you have created the script files, use the dbfhadmin utility to run them, and create the required databases.
dbfhadmin -createdb -file:<script-name.sql> -type:datastore -provider:db2
where <script-name.sql> is the name of the script file that was created in an earlier step.
Now that the datastores have been created, you can configure the database configuration file to use them.