WSO2 BAM supports four different databases.
To configure the datasource update WSO2BAM_HOME/repository/conf/datasources.properties file accordingly. (Also You can use datasources ui to edit the datasources.properties file.)
Sample configuration for a h2 datasource is as follows.
synapse.datasources=bamh2 synapse.datasources.icFactory=com.sun.jndi.rmi.registry.RegistryContextFactory synapse.datasources.providerPort=2199 synapse.datasources.bamh2.registry=JNDI synapse.datasources.bamh2.type=BasicDataSource synapse.datasources.bamh2.driverClassName=org.h2.Driver synapse.datasources.bamh2.url=jdbc:h2:repository/database/WSO2BAM_DB synapse.datasources.bamh2.username=wso2bam synapse.datasources.bamh2.password=wso2bam synapse.datasources.bamh2.dsName=bam_datasource synapse.datasources.bamh2.maxActive=100 synapse.datasources.bamh2.maxIdle=20 synapse.datasources.bamh2.maxWait=10000
Note:- Registry DB and BAM DB are independent to each other. User can manage both databases in two different database servers.
Alternatively it is possible to use -Dsetup parameter at BAM server startup time to create BAM database tables given that the database has been already created with necessary permissions in place. (with those mentioned in datasources.properties file).
e.g:
sh wso2server.sh -Dsetup
Note:- This will not drop tables and recreate them if BAM tables are already present in the database. If this is required it may be done using a database client tool for the respective database and manually running the appropriate script mentioned above for the particular database.