Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrate text box

Datasources can be configured in the application-externaldatasources.properties or in the  application-jndidatasources.properties file. When configuring external datasources , the externaldatasources profile should be enabled. When configuring JNDI datasources the jndidatasources profile should be enabled., 

Note

It is possible to enable both profiles but make sure a datasource is configured in just one of the .properties file.


A detailed description of the Blueriq properties file can be found on the Reference Guide: Properties.

A description of the usage of Spring profiles in Blueriq can be found here.

Hibernate Dialects: Oracle database, Microsoft (MS) SQL Server database

For Oracle use  as the oracle.jdbc.driver.OracleDriver and org.hibernate.dialect.Oracle10gDialectOracle12cDialect as the dialect.

For Microsoft SQL Server use com.microsoft.sqlserver.jdbc.SQLServerDriver as the driverClassName and org.hibernate.dialect.SQLServer2012Dialect as the dialect.

...

Code Block
titleapplication-externaldatasources.properties
blueriq.datasource.[datasource_name].url=jdbc:sqlserver://demo-host:1433;databaseName=db_main;instance=SQL_EXPRESS
blueriq.datasource.[datasource_name].username=username
blueriq.datasource.[datasource_name].password=password
blueriq.datasource.[datasource_name].driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
blueriq.datasource.[datasource_name].jndiName=
blueriq.datasource.[datasource_name].type=org.apache.commons.dbcp2.BasicDataSource

...

For dbcp2 datasources the following additional options are available:


 

Code Block
titleapplication-externaldatasources.properties
blueriq.datasource.[datasource_name].poolInitialSize=0
blueriq.datasource.[datasource_name].poolMaxTotal=8
blueriq.datasource.[datasource_name].poolMaxIdle=8
blueriq.datasource.[datasource_name].poolMinIdle=0
blueriq.datasource.[datasource_name].poolMaxWait=-1L
blueriq.datasource.[datasource_name].validationQuery=""
blueriq.datasource.[datasource_name].validationQueryTimeout=-1
blueriq.datasource.[datasource_name].testOnBorrow=true
blueriq.datasource.[datasource_name].testOnReturn=false
blueriq.datasource.[datasource_name].testWhileIdle=false
blueriq.datasource.[datasource_name].timeBetweenEvictionRunsMillis=-1
blueriq.datasource.[datasource_name].numTestsPerEvictionRun=3
blueriq.datasource.[datasource_name].minEvictableIdleTimeMillis=1800000 
 


An example configuration when using the externaldatasources profile:

type
Code Block
titleapplication-externaldatasources.properties
blueriq.datasource.main.url=jdbc:sqlserver://<database_url>:1433;databaseName=bq_main;instance=SQL_EXPRESS
blueriq.datasource.main.username=<username>
blueriq.datasource.main.password=<password>
blueriq.datasource.main.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
blueriq.hibernate.main.hbm2ddl.auto=
blueriq.hibernate.main.dialect=org.hibernate.dialect.SQLServerDialect

blueriq.datasource.trace.url=jdbc:sqlserver://<database_url>;databaseName=bq_trace;instance=SQL_EXPRESS
blueriq.datasource.trace.username=<username>
blueriq.datasource.trace.password=<password>
blueriq.datasource.trace.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
blueriq.hibernate.trace.hbm2ddl.auto=validate
blueriq.hibernate.trace.dialect=org.hibernate.dialect.SQLServerDialectSQLServer2012Dialect

blueriq.datasource.reporting.url=jdbc:sqlserver://<database_url>:1433;databaseName=bq_reporting;instance=SQL_EXPRESS
blueriq.datasource.reporting.username=<username>
blueriq.datasource.reporting.password=<password>
blueriq.datasource.reporting.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
blueriq.hibernate.reporting.hbm2ddl.auto=validate
blueriq.hibernate.reporting.dialect=org.hibernate.dialect.SQLServerDialect
UI Text Box
SQLServer2012Dialect
Info

While in earlier versions the datasources were sometimes shared between components, now each component has its own datasource. For an overview of components and plugins, see Installation

/ Configuration

.

JNDI datasources

When using the jndidatasources profile, the jndiName property should be set, the url, username, password and driverClassName aren't needed.

...

Code Block
titleapplication-jndidatasources.properties
blueriq.datasource.main.jndiName=java:/comp/env/jdbc/main
blueriq.hibernate.main.hbm2ddl.auto=create

blueriq.datasource.trace.jndiName=java:/comp/env/jdbc/trace
blueriq.hibernate.trace.hbm2ddl.auto=createvalidate

blueriq.datasource.reporting.jndiName=java:/comp/env/jdbc/reporting
blueriq.hibernate.reporting.hbm2ddl.auto=createvalidate

spring.jmx.enabled=false
endpoints.jmx.unique-names=true