Legacy method for configuring Datasources
Deprecation notice
Power Database Fields version 6.0+ only supports next-generation fields (Advanced Database Row Field and Advanced Database Table Field). Legacy fields were removed in version 6.0. If upgrading from version 5.8 or earlier, migration is required before upgrading. See the Migration page for details.
By default, JIRA runs in Tomcat, so the following example applies to Tomcat only. To learn how to define data source, refer to the application server manual.
Ensure that you have the SQL driver in JIRA_HOME/lib directory. The driver should be proper for the type of the (external to JIRA) database in use.
Open the JIRA_HOME/conf/context.xml file in a text editor. Enter your data source there, for instance, between the existing tags <Context> </Context>:
Hsqldb<Resource name="TestDB" auth="Container" type="javax.sql.DataSource" username="sa" password="" driverClassName="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:/tmp/somedb;create=true;" <!-- Optional, but highly recommended, add here the limits for your SQL database connection pool --> maxTotal="20" maxIdle="5" maxWaitMillis="-1" />Restart your Jira. You should be now ready to use the data source you just defined.
Check the settings in the Resource tag:
name: Appears in the general parameters as Database(JNDI name)
username: Username for connecting to the database
password: Password for connecting to the database
driverClassName: Name of the class from the driver. The driver should be a proper jar archive for the type of the database used.
In our example the type of the database used is hsqldburl: The url used to connect to the database
Settings for Other Databases
PostgreSQL
<Resource name="TestDB"
auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://127.0.0.1:5432/somedb"
/>
MySQL
<Resource name="TestDB"
auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/somedb"
/>
If you want to use a column alias in a select sql and use that alias instead of a column name you should add "?useOldAliasMetadataBehavior=true" as a configuration parameter in your JDBC url. This is due to a change in My SQL JDBC driver implementation starting with version 5.1.
You can find more details here.
If you use this parameter in combination with other parameters please also see this.
Oracle
<Resource name="TestDB"
auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@127.0.0.1:1522:somedb"
connectionProperties="SetBigStringTryClob=true"
/>
MS SQL Server
<Resource name="TestDB"
auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://localhost:1433/somedb;instance=INSTANCE_NAME"
/>
For MS Sql Server 2000 the instance name should be omitted from the url even if you are connecting to a named instance. Thus, the url attribute should be: url="jdbc:jtds:sqlserver://localhost:1433/somedb".
AS400
<Resource name="TestDB"
auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
url="jdbc:as400://127.0.0.1/somedb;naming=sql;errors=full"
/>
Firebird
<Resource name="TestDB" auth="Container" type="javax.sql.DataSource"
username="sysdba"
password="masterkey"
driverClassName="org.firebirdsql.jdbc.FBDriver"
url="jdbc:firebirdsql:127.0.0.1/3050:d:/somedb.fdb"
/>
If want to connect to Jira database, you can see its configuration in the dbconfig.xml file from Jira's home directory.
Contents:
Learn more: |
|---|
Need support? Create a request with our support team.
Copyright © 2005 - 2025 Appfire | All rights reserved.
