Unable to render embedded object: File (TeamCity48.png) not found.

TeamCity 9.x Documentation

Documentation for Previous Versions

Icon

You are viewing the documentation of TeamCity 9.x, which is not the most recently released version of TeamCity.
View this page in the latest documentation or refer to the listing to choose the documentation corresponding to your TeamCity version.

 

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Hide the section about JTDS driver

...

  1. Create a new database. As the primary collation, it is recommended to use the collation corresponding to your locale. We also suggest using the case-sensitive collation (collation name ending with '_CS_AS'), which is mandatory for the certain functionality (like using non-Windows build agents).
  2. Create TeamCity user and ensure that this user is the owner of the database (grant the user dbo rights). This requirement is necessary because the user needs to have ability to modify the database schema.
    If you're going to use SSL connections, ensure that the version of MS SQL server and the version of java (on the TeamCity side) are compatible. We recommend using the latest update of SQL server:
    • SQL Server 2012 - all versions
    • SQL Server 2008R2 - Service Pack 2 or Service Pack 1 cumulative update 6
    • SQL Server 2008 - Service Pack 3 cumulative update 4
    • SQL Server 2005 - only with JDK 6 update 27 or lower on the TeamCity side
      See details on compatibility issues.
  3. Allocate sufficient transaction log space. The requirements vary depending on how intensively the server will be used. It's recommended to setup not less then 1Gb.
On TeamCity server side

Show If

You can use either MS native JDBC driver (recommended) or JTDS JDBC driver one.

Anchor

native

native
Native driver

  1. Download the MS sqljdbc package from the Microsoft Download Center and unpack it. Let us assume the directory where you've unpacked the package into is called sqljdbc_home.
  2. Copy the sqljdbc4.jar from the just downloaded package into the TeamCity Data Directory/lib/jdbc directory.
  3. In the <TeamCity Data Directory>/config folder rename database.mssql.properties.dist file to database.properties file and specify the following required settings in this file:
    Code Block
    connectionUrl=jdbc:sqlserver://<host>:1433;databaseName=<database name>
    connectionProperties.user=<user>
    connectionProperties.password=<password>
    

...

More details about setup integrated security for MS SQL native jdbc driver can be found here (for MS SQL 2005) and here (for MS SQL 2008).

Anchor
jtds
jtds

Show If
JTDS driver

...

The JTDS driver does not support Unicode operations. Using the Microsoft native JDBC driver is recommended.

  1. Download the latest 1.2.x jTDS driver distribution file (zip file), unpack the jtds-*.jar driver jar and place it to <

...

  1. >/lib/jdbc. (TeamCity is not tested with the driver version 1.3+. It also requires that TeamCity server is run under JDK 1.7+).
  2. In the <

...

  1. >/config folder rename database.mssql.properties.dist file to database.properties and specify the required settings in this file:

...


connectionUrl=jdbc:jtds:sqlserver://<host>:1433/<database name>
connectionProperties.user=<user>
connectionProperties.password=<password>
connectionProperties.instance=<instance_name>

To use Windows authentication (SSPI) to connect to your SQL Server database, make sure there are no connectionProperties.user and connectionProperties.password properties specified in the database.properties file and also copy jtds-XXX-dist\x86\SSO\ntlmauth.dll file from the JTDS driver package to <TeamCity Home>\bin (when TeamCity is run under x86 JVM), for x64 JVM use jtds-XXX-dist\x64\SSO\ntlmauth.dll file. Also setup TeamCity server (service or process) to be run under user account that has access to the database.

...

The jtds driver doesn't know a "default" port value, so the port number in the connectionUrl is a mandatory parameter.

Please make sure SQL Server is configured to enable TCP connections on the port used in the connectionUrl.
If you use named instance you can specify the instance name by following means:

  • Add the "instance" property into the connection URL, like the following:
    connectionUrl=jdbc:jtds:sqlserver://<host>:1433/<database name>;instance=sqlexpress
  • Or, specify corresponding property in the database.properties file:
    connectionProperties.instance=<instance_name>

See also:

Panel
bgColor#FFFFFF
borderStyledashed

Installation and Upgrade: Migrating to an External Database

...