Versions Compared

Key

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

...

  1. First, [[#Install_a_JDBC_Driver | Locate and copy the necessary jdbc driver]] for your database into <frevvo-home>\tomcat\lib.
  2. Edit the file <frevvo-home>\tomcat\conf\Catalina\localhost\frevvo.xml
  3. You will see two data source definitions for each database type. '''name="jdbc/frevvoDS"''' is the form submissions database. '''name="jdbc/userDS"''' is the user database. See the above sample of the HSQLDB data source in the frevvo.xml file.
  4. Comment out the pair of the definitions for the default database (HSQLDB) using the <!-- --> comment characters. The entire section must be commented out:
Code Block
<!--

...


  HSQLDB Resource 
<Parameter name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" override="false"/>

...


        <Resource auth="Container"

...


                type="javax.sql.DataSource"

...


                factory="org.apache.commons.dbcp.BasicDataSourceFactory"

...


                name="jdbc/frevvoDS"

...


                driverClassName="org.hsqldb.jdbcDriver"

...


                username="sa"

...

                password=""
                url="jdbc:hsqldb:file:${catalina.home}/../data/db/forms"

...


                maxActive="200"

...


                maxIdle="20"
                maxWait="10000"

...


                validationQuery="select 1 from INFORMATION_SCHEMA.SYSTEM_USERS"

...


                testOnBorrow="true"
                testOnIdle="true"

...


                timeBetweenEvictionRunsMillis="10000"

...


                removeAbandoned="true"
                logAbandoned="true"/>

...


        <Parameter name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" override="false"/>

...


        <Resource auth="Container"

...


                type="javax.sql.DataSource"

...


                factory="org.apache.commons.dbcp.BasicDataSourceFactory"

...


                name="jdbc/userDS"

...


                driverClassName="org.hsqldb.jdbcDriver"

...


                username="sa"

...


                password=""
                url="jdbc:hsqldb:file:${catalina.home}/../data/db/users"

...

                maxActive="200"

...


                maxIdle="20"

...


                maxWait="10000"
                validationQuery="select 1 from INFORMATION_SCHEMA.SYSTEM_USERS"

...


                testOnBorrow="true"

...


                testOnIdle="true"
                timeBetweenEvictionRunsMillis="10000"

...


                removeAbandoned="true"

...


                logAbandoned="true"/>
 -->

Next, uncomment the pair of definitions for your database. Ex: if you are using SQL server, uncomment the definition for SQLSERVER Resource.<pre>

Code Block

...

 <!--

...


                SQLSERVER Resource  
   -->
  
        <Parameter name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" override="false"/>

...


        <Resource auth="Container"

...


                factory="org.apache.commons.dbcp.BasicDataSourceFactory"

...


                maxActive="200"

...


                maxIdle="20"

...


                maxWait="10000"

...


                validationQuery="select

...

 1"
                testOnBorrow="true"
                testOnIdle="true"

...


                timeBetweenEvictionRunsMillis="10000"

...


                removeAbandoned="true"
                logAbandoned="true"

...


                name="jdbc/frevvoDS"

...


                driverClassName="net.sourceforge.jtds.jdbcx.JtdsDataSource"

...


                username="root"

...


                password=""

...


                type="javax.sql.DataSource"

...


                url="jdbc:jtds:sqlserver://localhost/frevvoSubmissions"/>

...


          <Resource auth="Container"

...


                factory="org.apache.commons.dbcp.BasicDataSourceFactory"

...


                maxActive="200"

...


                maxIdle="20"

...


                maxWait="10000"

...


                validationQuery="select 1"
                testOnBorrow="true"

...


                testOnIdle="true"

...


                timeBetweenEvictionRunsMillis="10000"

...


                removeAbandoned="true"
                logAbandoned="true"

...


                name="jdbc/userDS"

...


                driverClassName="net.sourceforge.jtds.jdbcx.JtdsDataSource"

...


                username="root"

...


                password=""

...


                type="javax.sql.DataSource"

...


                url="jdbc:jtds:sqlserver://localhost/users"/>

</pre> 


Configure  Configure the frevvo submissions database

...

Note also that the following settings affect only the frevvoDS database schema (and not the userDS schema) and that any changes to these settings will force frevvo to create a schema that is different than the pre-generated scripts found in frevvo/data/sql/forms-*.sql when the schema is initially empty (you have to start from an empty schema).

How can you make database object names are uppercase or lowercase? You can affect this by  editing the frevvo/tomcat/conf/Catalina/localhost/frevvo.xml and adding the following parameter:

Code Block
<Parameter name="teneo.naming.strategy" value="uppercase" override="false" />

How can you make sure that all database object names have a max length (e.g. Oracle specifies a max of 32 chars)? You can affect this by  editing the frevvo/tomcat/conf/Catalina/localhost/frevvo.xml and adding the following parameter:

Code Block
<Parameter name="teneo.naming.max_sql_name_length" value="30" override="false" />

How can you specify a custom name escape character? You can affect this by  editing the frevvo/tomcat/conf/Catalina/localhost/frevvo.xml and adding the following parameter:

...