【发布时间】:2015-06-15 20:57:03
【问题描述】:
我是 esper 的新手。当 esper 识别满足 eql 查询的事件时,我想将事件存储在 mysql 数据库中。首先,我查找此示例 Esper: How to configure Esper to connect a Relational Database, through a JDBC, using Esper's configuration API 并尝试提出解决方案。
<plugin-loader name="EsperIODBAdapter" class-name="com.espertech.esperio.db.EsperIODBAdapterPlugin">
<config-xml>
<esperio-db-configuration>
<jdbc-connection name="database">
<drivermanager-connection class-name="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/CEP_DEMO"
user="user" password="password"/>
<connection-settings auto-commit="true" catalog="TEST"/>
</jdbc-connection>
<dml connection="database" stream="event" >
<sql>INSERT INTO BasicEvent(userId,eventId,eventUsage,eventDateTime) values(?,?,?,?) </sql>
<bindings>
<bindings>
<parameter pos="1" property="userId"/>
<parameter pos="2" property="eventId"/>
<parameter pos="3" property="eventUsage"/>
<parameter pos="4" property="eventDateTime"/>
</bindings>
</bindings>
</dml>
</esperio-db-configuration>
</config-xml>
</plugin-loader>
然后当我运行应用程序时,它没有向表中插入数据。我想知道我的方法是正确的还是有其他方法可以配置。
谢谢
【问题讨论】:
标签: java mysql configuration insert esper