SurveyTool Database configuration.

Out of Date. To fix in

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


  • 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. 
      1. This is partly because full Unicode support was lacking when the SurveyTool was developed, and so binary blobs are used for Unicode data.
      2. Furthermore, we need uniqueness indices for XPaths. 
  3. Download and install the MySQL 5 Connector for J  into your tomcat's lib/ directory (you don't need to build against it)
  4. 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.

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

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

    Put the following near the end of the file, before the final "</Context>".  Change the boldfaced parts as appropriate.
    <Resource name="jdbc/SurveyTool"