Time for action – changing to a production-ready database
Activiti comes with a default database, H2. This database is only used for the purposes of demonstration. For production, we have to change the database. So, let's see how we can configure the database:
To configure Activiti with a database, we have to create a schema named MySQL.
We will also create another schema named activitiin mysql.
Now, we have to configure Activiti with MySQL. In order to do this, we have to browse to apache-tomcat-7.0.27/webapps/activiti-Explorer/WEB-INF/classes/db.properties.
Also, we have to place mysql-connector-java-5.1.18-bin.jar into apache-tomcat-7.0.27/webapps/activiti-Explorer/WEB-INF/lib.
After performing these steps, we have to restart the Tomcat server if it is already running. If not, just start the Tomcat server.
Once the Tomcat server has started successfully, the Activiti schema will be populated with the default tables of Activiti.
What just happened?
In this section, we saw how to set up a production database in Activiti. We have also seen how to make changes in db.properties and learned how to populate all the tables into the MySQL database.