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:

  1. To configure Activiti with a database, we have to create a schema named MySQL.
  2. We will also create another schema named activitiin mysql.
  3. 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.
  4. Make the following changes in db.properties:
    db=activiti
    
    jdbc.driver=com.mysql.jdbc.Driver
    
    jdbc.url=jdbc:mysql://localhost:3306/activiti
    
    jdbc.username=root
    
    jdbc.password=root
  5. 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.
  6. After performing these steps, we have to restart the Tomcat server if it is already running. If not, just start the Tomcat server.
  7. 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset