Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Configuration Steps

1) &nbsp;&nbsp;  Copy the JDBC driver appropriate for your database into <frevvo-home>\tomcat\webapps\database\WEB-INF\lib*

Info

The database connector contains pre-installed drivers for the most popular databases. So you may be able to skip this step. See [[#Install_a_JDBC_driver | Install a JDBC driver]] below

2) &nbsp;&nbsp;   If you did have to copy a JDBC driver into lib you must then Restart frevvo, Double click <frevvo-home>\stop-frevvo. Wait until frevvo stops. Then Double click <frevvo-home>\start-frevvo

3) &nbsp;&nbsp;   [[#Define_the_Data_Source | Configure your database connector Data Source]] by editing <frevvo-home>\tomcat\webapps\database\WEB-INF\etc\configuration.xml

4) &nbsp;&nbsp;   [[#Define_the_SQL_Statements | Define SQL Statements]] to read/write to your databasse by editing <frevvo-home>\tomcat\webapps\database\WEB-INF\etc\configuration.xml.[[Image:18px-Symbol_OK.svg.png]]

Tip

We recommend that you do not leave your database configuration.xml file in its default locations. See [[#Configuration_File_Location | configuration file location]] below.

Configuration File Location

Tip

We recommend not leaving the database configuration file in its default location under the <frevvo-home>\tomcat\webapps\database\WEB-INF\etc\configuration.xml.

...

One benefit of moving configuration.xml is any SQL query changes you make as you are in the development cycle will immediately be picked up by the database connector without having to stop/restart the connector. This can be very convenient

...

.

To move configuration.xml to c:/frevvo/dbconfig#

  1. Create folder c:/frevvo/dbconfig

...

  1. Copy <frevvo-home>\tomcat\webapps\database\WEB-INF\etc\configuration.xml to c:\frevvo\dbconfig\configuration.xml

...

  1. Edit <frevvo-home>\tomcat\conf\catalina\localhosts\context.xml.default. Add this line to context.xml.default (as a Parameter tag):

...

Code Block
<Parameter name="frevvo.connectors.database.configuration"

...


value="c:/frevvo/dbconfig/configuration.xml" override="false"/>

</pre>Note: If frevvo is running, when you edit and save this change to context.xml.default, frevvo should pickup this change within a couple seconds. If it doesn't, then stop and restart frevvo by: Double click <frevvo-home>\stop-frevvo. Wait for it to stop. Then double click <frevvo-home>\start-frevvo

...

The frevvo database connector needs to know:*

  • the path to your database

...

  • a username to login to your database

...

  • a password for this username

...

  • which JDBC driver your database requires.

This information is setup in the file <frevvo-home>\tomcat\webapps\database\WEB-INF\etc\configuration.xml. If you moved this file out of the webapps\database directory to a better [[#Configuration_File_Location | configuration file location]] then edit the file there.

To configure the database connector to interact with your database:#

  1. Edit configuration.xml

...

  1. You will see a <queryset> element already in this file (approx 164 lines long). This is the test query you ran when first [[#Starting_and_Testing_the_Connector | testing the database connector installation]].

...

  1. Make a duplicate copy of the entire <queryset> element (all approx 164 lines) so that you have two <queryset> elements in the configuration.xml

...

  1. Edit the <resource-def> element in the <queryset> element you just duplicated. The <resource-def> element defines where and how to connect to your own database.

This is the format of the <resource-def> element:

...

<pre>
<resource-def>
    <url>jdbc:as400://170.254.98.250:8888;date separator=-</url>       
    <driver>com.ibm.as400.access.AS400JDBCDriver</driver>
    <user>yourUser</user>
    <password>yourPassword</password>
</resource-def>
</pre>