SurveyTool Database configuration.

Basic setup is covered in the Step-By-Setup setup.

JNDI

    • SurveyTool looks for "jdbc/SurveyTool" as a JNDI name. In the future, this will be the only configuration needed.

    • At start-up, the Survey Tool will create any tables needed.

    • You will be editing context.xml to add a <Resource...> element as described in the following sections. context.xml is either in your server's runtime directory, or in the following location if you are using Eclipse:

Database Specific Instructions

Automated Derby (easier to setup, but doesn' t support all SurveyTool features)

  1. Simply startup the Survey Tool without configuring the database. Right-click on "cldr-apps" and choose "Run on Server". Wait for the web page to load.

  2. An empty database will be created for you, and configuration information will be shown on the initial webpage. It will be an XML element starting with "<Resource …"

  3. Copy the entire <Resource>…</Resource> element into the <Context> element located in context.xml ( see previous section, JNDI. )

  4. Right-click the server and choose Restart.

  5. SurveyTool should start up normally.

Derby is no longer recommended and will soon be unsupported. CLDR-8383

MySQL (production use, full featured)

    1. Set up MySQL 5

      1. On Linux, use your distribution's package manager. On Mac, use homebrew

      2. Note: you must run 'mysql_secure_installation' or equivalent to set a root password, otherwise other access control settings will be silently ignored.

      3. (Recommended: I like to use the "MySQL workbench" GUI to administer mysql)

    2. Create a database (schema), for example 'cldrdb', with the user, for example, 'usernam3' with the password 'passw0rd'

      1. Ironically, the database should be created with latin1 (latin1_bin) codepage and encoding.

      2. This is partly because full Unicode support was lacking when the SurveyTool was developed, and so binary blobs are used for Unicode data.

      3. Furthermore, we need uniqueness indices for XPaths.

  1. Note that the SurveyTool Setup tool has a "MySQL Configurator.." button at the last page. You can use this to generate the <Resource> element below.

    1. Set up the JNDI resource.You will need to add the following <Resource ... item to the server's context.xml.

    2. If you are using Eclipse, you can find the context.xml in the "Servers" project, under "Tomcat … Server on Localhost" as "context.xml".

    3. Put the following near the end of the file, before the final "</Context>". Change the boldfaced parts as appropriate.

      1. <Resource name="jdbc/SurveyTool"

        1. auth="Container"

        2. type="javax.sql.DataSource"

        3. username="usernam3"

        4. password="passw0rd"

        5. driverClassName="com.mysql.jdbc.Driver"

        6. url="jdbc:mysql://localhost:3306/cldrdb?ConnectionRetryCount=5&ConnectionRetryDelay=20&amp;useJDBCCompliantTimezoneShift=true&amp;useLegacyDatetimeCode=false&amp;serverTimezone=UTC"

        7. maxActive="8"

        8. maxIdle="4"

        9. removeAbandoned="true"

        10. removeAbandonedTimeout="60"

        11. logAbandoned="true"

        12. defaultAutoCommit="false"

        13. poolPreparedStatements="true"

        14. maxOpenPreparedStatements="150"

        15. />