You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.
Introduction
Two types of datasources can be configured in the Runtime: JDBC and JNDI. A datasource must be defined in the application.properties
file. The development tools component provides a web UI for modifying the properties file and can be used instead of editing the file directly.
The following sections document all the configuration values available when using the properties file and provide a brief overview of using the development plugin for managing the datasources.
Important
This page describes only how a datasource is configured. Using the datasource is outside the scope of this page. Check the documentation of the plugin you intend to use for information on how a datasource is supposed to be used.
When configuring multiple connections, please make sure they have separate datasources. Using the same datasource is known to cause errors.
Using the properties file
Configuring a JDBC datasource
Configuring a JDBC datasource named datasource_name must be done by setting the following mandatory properties:
blueriq.connection.datasource_name.sql.type=jdbc blueriq.connection.datasource_name.sql.url= blueriq.connection.datasource_name.sql.driver= blueriq.connection.datasource_name.sql.username= blueriq.connection.datasource_name.sql.password=
The value of these parameters depend on which type of database the connection is made to, so details can be found in the documentation specific to the database type.
A number of optional parameters exist for configuring the connection pool settings. They can be used in constructs similar to
blueriq.connection.datasource_name.sql.poolInitialSize=5
The parameters are:
Parameter | Default | Description |
---|---|---|
poolInitialSize | 0 | The initial number of connections that are created when the pool is started. |
poolMaxTotal | 8 | The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit. |
poolMaxIdle | 8 | The maximum number of connections that can remain idle in the pool, without extra ones being released, or negative for no limit. |
poolMinIdle | 0 | The minimum number of connections that can remain idle in the pool, without extra ones being created, or zero to create none. |
poolMaxWait | -1 | The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or -1 to wait indefinitely. |
Disclaimer
The descriptions above and the default values are taken from the Apache Commons DBCP website.
Not setting a connection pool optional parameter results in a DEBUG message in the log in the form: SqlConnectionData datasource_name has no poolMaxTotal property set explicitly. Default value 8 will be used.
Setting a connection pool parameter to an invalid value will result in a WARNING message in the log in the form: SqlConnectionData datasource_name was initialized with poolMaxTotal=eight, but it is not a valid number. Default value 8 will be used.
Using the development plugin settings always creates the optional settings in the properties file. See more details in the development plugin section.
Configuring a JNDI datasource
Configuring a JNDI datasource named datasource_name must be done by setting the following mandatory properties:
blueriq.connection.datasource_name.sql.type=jndi blueriq.connection.datasource_name.sql.jndi=jndi_resource_name
The procedure of creating a JNDI datasource is container-specific. Please consult the documentation of the application server running the application on how to create a JNDI datasource.