Versions Compared

Key

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

Adding a JNDI Datasource

 

By default, Jira runs in Tomcat, so the following example applies to Tomcat only. The user should refer to the application server manual on how to define a data source.

  1. Make sure you have the SQL driver in JIRA_HOME/lib directory. The driver should be proper one for the type of the database you want to use.
  2. Open JIRA_HOME/conf/context.xml file with your favorite text editor. Enter your data source, for instance, between the existing <Context> tags copy the following content:

    Code Block
    titleExample for HSQLDB
    <Resource name="TestDB"
              auth="Container" type="javax.sql.DataSource"
              username="sa"
              password=""
              driverClassName="org.hsqldb.jdbcDriver"
              url="jdbc:hsqldb:/tmp/somedb;create=true;"
     />
    
  3. Restart Jira.  


Check the settings in the Resource tag:

  • name: the name of the data source
  • username: The username used for the connection to the database
  • password: The password to connect to the database
  • driverClassName: The name of the class from the driver. The driver should be the proper jar archive for the type of the database used. In this example the type of the database used is hsqldb
  • url: The url used to connect to the database

...


Note
titleNote

The Guide on how to configure a datasource is Apache Tomcat: Configuring a Datasource

...