Section | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
- Stop the Standalone Database Connector
Navigate to the <db-home>\database-connector-2.5.x\config directory.
Create the file <frevvo-home>\config\configuration.xml.
Copy/Paste the following text into configuration.xml. This skeleton defines test querysets named myStore and BIRT to get you started.
Code Block <dbconnector> <queryset name="myStore"> </queryset> <queryset name="BIRT"> </queryset> </dbconnector>
Edit <db-home>\database-connector-2.5.x\config\configuration.xml. The dbconnector.properties file is where you can customize database connection properties (such as server port) and configure datasource definitions. Add the datasource definitions for your querysets/queries to this file then save it.
Copy/Paste one of the two following samples into dbconnector.propertiesunder the server.port property.
Code Block title Use this sample if all querysets use the same database # Customize the DbConnector here logging.file=./logs/database-connector.%d{yyyy-MM-dd}.log server.port=8081 dbconnector.queryset.resource-def.url=<the url to your database> dbconnector.queryset.resource-def.user=<your database username> dbconnector.queryset.resource-def.password=<your database password>
The @myStore and @BIRT in the this sample will be your queryset names in your configuration.xml
Code Block title Use this sample if querysets use different databases frevvo.connectors.database.configuration=file:///C:/frevvo/config/configuration.xml# Customize the DbConnector here logging.file=./logs/database-connector.%d{yyyy-MM-dd}.log server.port=8081 dbconnector.queryset@myStore.resource-def.url=<the url to your database #1> dbconnector.queryset@myStore.resource-def.user=<your database username> dbconnector.queryset@myStore.resource-def.password=<your database password> dbconnector.queryset@BIRT.resource-def.url=<the url to your database #2> dbconnector.queryset@BIRT.resource-def.user=<your database username> dbconnector.queryset@BIRT.resource-def.password=<your database password>
Tip You can see more examples of datasource definitions here
Restart the connector using one of these methods:
Open a command prompt and navigate to the <db-home>\database\database-connector-2.5.x directory
Type java -jar database.warClick the Restart-DBConnector-Service.bat,sh to restart the service for your operating system if you instl. Click below for a list of the batch files and shell scripts that come with the connector.
Expand title Click here Insert excerpt frevvo72:DB Connector Installation frevvo72:DB Connector Installation nopanel true
Browse the http://localhost:8081/database/status page
Verify that query validation page is loaded with status Passed and is pointing to your custom configuration.xml file.
...
If you prefer to define your datasources on the container level, the recommended approach is to define the datasource in the container and then use a resource-ref in the Database Connector properties file to reference it..
Info |
---|
Using <Resource-ref> to define datasources is not supported if you are running the Database Connector in Standalone mode. Use <Resource-def> instead. |
...
Add the enabled= attribute with a value of false to the <querySet/> or individual <query> elements in the configuration.xml file to completely disable it.
Code Block <dbconnector> <querySet name="BIRT" enabled="false" ...>
The same can be done by adding the enabled property with a value of false as shown below to the dbconnector.properties(standalone bundle) or frevvo-config.properties (tomcat bundle).
Code Block dbconnector.querySet@<queryset name>.enabled=false
This property disables all querysets. Add it to the dbconnector.properties(standalone bundle) or frevvo-config.properties (tomcat bundle).
Code Block dbconnector.querySet.enabled=false
...