01. Configuration
ConfigurationGeneric Database
The Generic Database plugin is configured by adding a plugin section to the Noojee Answer configuration.
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.
"plugins": { "JdbcPlugin": { "params.jdbcUrl": "jdbc:mysql://127.0.0.1/asterisk?user=asterisk&password=fred", "params.driverClass": "com.mysql.jdbc.Driver", "params.query": "call getData(?,?,?,?,?,?,?,?)", "channelVariables": ["account","country"] } },
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.