Page History
...
- Stop the Standalone Database Connector
Navigate to the <db-home>\database-connector-2.5.x\config directory.
Create the a file named 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\dbconnector.properties. The dbconnector.properties file is where you can customize database connection properties (such as server port) and configure datasource definitions.
Copy/Paste one of the two following samples under 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 # 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>
Your Datasource Properties depend on your JDBC driver type. To see examples of Datasource Definitions,
Expand title Click here MySQL example
This sample shows a configuration.xml queryset named "alltest" against a MySql database named "test" where the database login user is "root" and the password is "root".
Code Block dbconnector.queryset@alltest.resource-def.url=jdbc:mysql://<your database server>:<port>/test dbconnector.queryset@alltest.resource-def.user=root dbconnector.queryset@alltest.resource-def.password=root
SQL Server Example
This example connects to a SQL Server driver
Code Block dbconnector.queryset@BIRT.resource-def.url=jdbc:sqlserver://<your database server>;DatabaseName=<your database name> dbconnector.queryset@BIRT.resource-def.user=<your database user> dbconnector.queryset@BIRT.resource-def.password=<your database password>
SQL jTDS Example
This example connects to SQL Server using the jTDS driver. The jTDS driver requires the additional validationQuery property.
Code Block dbconnector.queryset@myStore.resource-def.url=jdbc:sqlserver://<your database server>:<port>;DatabaseName=<your database name> dbconnector.queryset@myStore.resource-def.user=<your database name> dbconnector.queryset@myStore.resource-def.password=<your database password> dbconnector.queryset@myStore.resource-def.validationQuery=SELECT 1
If your SQL server has multiple SQL named instances, use the url instance parameter as shown here for an instance named xyzzy.
Code Block dbconnector.queryset@myStore.resource-def.url=jdbc:sqlserver://<your database server>:<port>;DatabaseName=<your database name>;instance=xyzzy
Oracle 11g
This example connects to an Oracle 11g driver.
Code Block dbconnector.queryset@mystore.resource-def.url=jdbc:oracle:thin:@<your database server>:<port>:ServiceName dbconnector.queryset@myStore.resource-def.user=<your database user> dbconnector.queryset@myStore.resource-def.password=<your database password>
Restart the connector using one of these methods:
- Method 1: Using java in a command window
- Navigate to <db-home>\database-connector-2.5.x .Type java -jar database.war
- Method 2: for Windows OS
Double click the <db-home>\database-connector-2.5.x\Install-Service.bat file to install the connector as a Windows service. Click the Start-DBConnector-Service.bat file to start it
Expand title Click to see standalone bundle content details Excerpt The Standalone Database Connector bundle includes the files shown in the image:
Note the files in the database-connector-2.5.x directory that are used to manage the Database Connector as services on *nix and Windows operating systems: These files should be run as an administrator.
Install-Service.bat - installs the Database Connector on a Windows system as a service named frevvo Database Connector.
Uninstall-service.bat - uninstalls the frevvo Database Connector on a Windows operating system
Start-DB Connector-Service.bat - starts the frevvo Database Connector on a Windows operating system
Start-DBConnector.sh - starts the frevvo Database Connector as a *nix console instance.
Restart-DBConnector-Service.bat - restarts the frevvo Database Connector on a Windows operating system
Restart-DBConnector.sh - restarts the frevvo Database Connector as a *nix console instance.
Stop-DBConnector-Service.bat - stops the frevvo Database Connector on a Windows operating system.
Stop-DbConnector.sh - stops the frevvo Database Connector *nix console instance.
- Method 3 for *nix OS
- Execute the DB Connector.sh shell script for Unix/Linux operating systems.
- Method 4 for Linux
- The Database Connector can also run as a service under Linux systemd
- The Database Connector can also run as a service under Linux systemd
Expand title Click here for the details It is possible to manage the Database Connector using systemd ‘service’ scripts.
- Copy the sample service file located in /bin/dbconnector.service to /etc/systemd/system
- Review it's contents and
- Make sure it is executable.
You can now use systemd to manage the dbconnector service:
systemctl start dbconnector.service
systemctl stop dbconnector.service
systemctl restart dbconnector.service
systemctl status dbconnector.service
To flag the service to start automatically on system boot use the following command:
Code Block systemctl enable dbconnector.service
Consult the service unit configuration man page for more details.
- Method 1: Using java in a command window
Browse http://localhost:8081/database/status
Your skeleton database configuration is successful when the status returns Passed! for each queryset.
- You are now ready to define your SQL Queries.
...