Persisting the process data

This section will explain how we can persist the process data into a data store. We are using MySQL as a data store for the log processing use case. I am assuming you have MySQL installed on your centOS machine or you can follow the blog at http://www.rackspace.com/knowledge_center/article/installing-mysql-server-on-centos to install the MySQL on the centOS machine. Let's perform the following steps to persist the record into MySQL:

  1. Add the following dependency to pom.xml:
 
       <dependency> 
             <groupId>mysql</groupId> 
             <artifactId>mysql-connector-java</artifactId> 
             <version>5.1.6</version> 
       </dependency> 
  1. We are creating a MySQLConnection class in the com.stormadvance.logprocessing package. This class contains getMySQLConnection(String ...

Get Mastering Apache Storm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.