ConfigurationGeneric Database
The Generic Database plugin is configured by adding a crm-plugin section to the Noojee Answer xml configuration file:
/WEB-INF/conf/toolbar.xml
Read more about configuring Noojee Answer 03. Configuration.
The Generic Database plugin is uses the JdbcPlugin class. To configure the JdbcPlug you need to specify the following parameters:
Name | Description |
---|---|
class | The class name of the plugin to load which for the Generic Database plugin must be: au.com.noojee.answerbar.server.plugin.JdbcPlugin |
params.jdbcUrl | The JDBC connection URL to the database. |
driverClass | The driver class to load for your particualar database. e.g. for My SQL use: com.mysql.jdbc.Driver |
query | The query to execute on your database. It must accept eight parameters. |
The remaining settings are all generic Plugin settings.
<crm-plugin> <class>au.com.noojee.answerbar.server.plugin.JdbcPlugin</class> <params> <jdbcUrl>jdbc:mysql://127.0.0.1/asterisk?user=asterisk&password=fred </jdbcUrl> <driverClass>com.mysql.jdbc.Driver</driverClass> <query>call getData(?,?,?,?,?,?,?,?)</query> <channelVariable>account</channelVariable> <channelVariable>country</channelVariable> </params> <filter> <didPattern>410</didPattern> <queue>test</queue> </filter> </crm-plugin>
Note: Escaping special charactersGeneric Database
You might have to escape certain parts of the jdbcURL value because of the inclusion of special characters such as spaces, semicolons, and quotation marks. The JDBC driver supports escaping these characters if they are enclosed in braces. For example, {;} escapes a semicolon.
Escaped values can contain special characters (especially '=', ';', '[]', and space) but cannot contain braces. Values that must be escaped and contain braces should be added to a properties collection.
Noojee recommend that your database name only contain alphnumeric characters.