If you were using version 2.4 of the Database Connector in your previous installation, you can use the configuration files from that installation with version 2.5+ of the connector. This will work if you are running the connector in the tomcat bundle or standalone.
On This Page:
Configure the v2.5+ connector using the 2.4 configuration files in the tomcat bundle
Follow these steps:
- Stop if it is running. You do not have to stop the Insight Server.
- Copy the v2.5 database.war into <frevvo-home>\tomcat\webapps directory in your the v7.2+installation.
Copy the JDBC driver appropriate for your database into <frevvo-home>\tomcat\lib if it is not there already.
The database connector contains some pre-installed drivers. So you may be able to skip this step. See the Install a JDBC driver topic.
Add this parameter to the v7.2+ frevvo-home>\tomcat\conf\Catalina\localhost\context.xml.default file. This file contains the path parameter to the configuration.xml file. The connector will pick up the configuration.xml file if it is located in the current working directory (where the DB Connector was launched) or you can create a <frevvo-home>/config/ directory and copy the v2.4 configuration.xml there. It can also be manually set by using the frevvo.connectors.database.configuration property in the context.default..xml file if you are deploying the connector in the tomcat bundle. Here is an example:
<Parameter name="frevvo.connectors.database.configuration" value="<path>\<to>\configuration.xml" override="false"/>
Be sure to add it OUTSIDE of the manager tags in the file. Also, verify that your path to the configuration file is correct. Here is an example of how the file should look after editing:
<Context swallowOutput="true" unloadDelay="40000" useHttpOnly="true"> <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"> <Store className="org.apache.catalina.session.FileStore"/> </Manager> <Parameter name="insight.server.url" value="http://localhost:8983/solr" override="false"/> <Parameter name="frevvo.connectors.database.configuration" value="C:\frevvo-721-DLGA\frevvo\dbconfig\configuration.xml" override="false"/> </Context>
Copy the configuration.xml file from your previous installation to the path specified in the frevvo-home>\tomcat\conf\Catalina\localhost\context.xml.default file.
If you used <resource-def>...</resource-def> to configure database resources in the 2.4 configuration.xml, you can just leave them there.
- If you used <resource-ref>...</resource-ref> to configure database resources in the 2.4 configuration, make sure the <Resource-ref> definition is included in <frevvo-home>\tomcat\conf\Catalina\localhos\context.default.xml file.
- Click the arrow below for more information about resource-def and resource-ref elements.
Browse http://localhost:8082/database/status page
Verify that query validation page is loaded with status Passed
- Log into your tenant and test your forms and flows that interact with your database.
Defining Datasources in the configuration.xml file
The Database Connector need to know where and how to connect to your database. Datasources are defined using resource-def/resource-ref elements for each queryset in your configuration.xml file
The Live Forms 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.
Using <resource-def> in the v2.4 configuration.xml file
. If you are using the configuration.xml file from your previous DB connector installation, the format of the <resource-def> element that you will see in your configuration.xml file is shown below:
<resource-def> <url>YOUR database Url HERE</url> <driver>YOUR driver HERE</driver> <user>YOUR database user HERE</user> <password>YOUR password HERE</password> </resource-def>
Using the v2.4 configuration.xml file that contains <resource-ref> with the v2.5 connector
If you configured <resource-ref> in the previous installation then follow these steps to use your v2.4 configuration file with the v2.5 connector:
Edit frevvo\tomcat\conf\Catalina\localhost\context.xml.default file in your v7.2 installation to add the "frevvo.connectors.database.configuration' and Resource Name parameters if they are not already defined. A sample context.xml.default file for MySQL is shown below
<Context swallowOutput="true" unloadDelay="40000" useHttpOnly="true"> <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"> <Store className="org.apache.catalina.session.FileStore"/> </Manager> <Parameter name="insight.server.url" value="http://localhost:8983/solr" override="false"/> <Parameter name="frevvo.connectors.database.configuration" value= "<path to the configuration.xml file>" override="false"/> <Resource name="jdbc/<your database name>" auth="Container" driverClassName="com.mysql.jdbc.Driver" username="<your database user>" password="<your database password>" type="javax.sql.DataSource" url="jdbc:mysql://localhost/<your queryset name>?autoconnect=true"/> </Context>
- Verify that the resource-ref is defined in your configuration.xml file for each queryset.
- Alternatively, you can copy frevvo\tomcat\conf\Catalina\localhost\context.xml.default and dbconfig\configuration.xml to appropriate location in the v7.2+ tomcat bundle.
Configure the v2.5 connector using the 2.4 configuration files in Standalone mode
- Stop the Db Connector if it is running. You can do this by closing the window if you started the DB Connector with the java command, running the Stop-DB Connector.sh file for *nix OS or the Stop-Db Connector-Service.bat file for Windows OS.
- Copy the 2.4 configuration.xml file to the <db-home>\database\database-connector-2.5.0\config folder.
Copy the JDBC driver appropriate for your database into <db-home>\lib. Remember the database connector contains some pre-installed drivers. So you may be able to skip this step. See the Install a JDBC driver topic.
- Restart the connector using one of these methods
- Open a command prompt and navigate to the <db-home>\database\database-connector-2.5.0 directory
- Type java -jar database.war
- Type java -jar database.war
- Click the Restart-DBConnector-Service.bat to restart the service for a Windows operating system or execute the Restart - DBConnector.sh shell script for *nix operating systems.
- Open a command prompt and navigate to the <db-home>\database\database-connector-2.5.0 directory
Examples of Datasource Definitions in the configuration.xml file
MySQL example
A mySql database named "test" running on localhost on the default port when the login for user "root" requires no password:
<resource-def> <url>jdbc:mysql://localhost/test</url> <driver>com.mysql.jdbc.Driver</driver> <user>root</user> <password></password> </resource-def>
A database URL is a Universal Resource Locator (URL) that specifies a particular type of database server (compatible with the JDBC driver you installed or was pre-installed in database\WEB-INF\lib) and a particular host. In addition you can also specify the database name to use for the connection.
The format for the database URL is database driver specific. In the example above for mySql the correct format is:
jdbc:mysql://[host][:port optional]/[database name]
Check with your database administrator or the documentation for your database drive for details on the correct database URL format.
HSQLDB example
Here is an example that connects to an '''HSQLDB driver'''.
<resource-def> <url>jdbc:hsqldb:file:mystore</url> <driver>org.hsqldb.jdbcDriver</driver> <user>sa</user> <password></password> </resource-def>
The following examples are for several common databases. Please consult your database documentation and version for the exact configuration settings.
SQL Example
Here is an example that connects to a '''SQL Server driver'''.
<resource-def> <url>jdbc:sqlserver://192.168.1.102;DatabaseName=mystore;</url> <driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver> <user>yourUser</user> <password>yourPassword</password> </resource-def>
SQL jTDS Example
This Url connects to a SQL Server using the jTDS driver that works with Microsoft SQL 2008
<resource-def> <url>jdbc:jtds:sqlserver://localhost:1433;DatabaseName=db;</url> <driver>net.sourceforge.jtds.jdbcx.JtdsDataSource</driver> <user>yourUser</user> <password>yourPassword</password> </resource-def>
For SQL server, the database name can also be specified as part of the Url rather than using the DatabaseName optional parameter. For example if your database name is acswa and the SQL server is running on 59377:
<url>jdbc:jtds:sqlserver://<sqlhost>:59377/acswa</url>
As of SQL 2000, Microsoft SQL allows installation of multiple SQL named instances. If your SQL server was installed this way you must use the instance parameter. For example if you database instance was named xyzzy:
<url>jdbc:jtds:sqlserver://<sqlhost>:59377/acswa;instance=xyzzy</url>
Oracle 11g
Here is an example that connects to an Oracle 11g driver.
<resource-def> <url>jdbc:oracle:thin:@localhost:1521:ServiceName</url> <driver>oracle.jdbc.driver.OracleDriver</driver> <user>yourUser</user> <password>yourPassword</password> <validationQuery>select 1 from dual</validationQuery> </resource-def>