This Question is Not Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
5 Replies Last post: Mar 31, 2014 10:58 AM by Bruce Lackore  
Bruce Lackore Newbie 3 posts since
Mar 14, 2014
Currently Being Moderated

Mar 14, 2014 6:50 AM

Trying to evaluate TeamCity - can't connect to my SQL Server db

I'm trying to solve what should be a simple problem. Connecting TeamCity to my db (separate server on separate machine). The error message is: TeamCity server is connecting to MSSQL database.  The database server is not started yet, or the connection properties are not properly set.The server is on another machine (a vm) that I can access from the same box TC is installed on via SSMS.I'm attempting to use the recommended driver, my database.properties file follows:# This is a sample file for configuring TeamCity to use an external database.# To make it effective, copy it to the "database.properties" file and modify the settings# according to your environment.# Do not modify this file, it will be overwritten on the TeamCity server start-up.# See documentation at http://confluence.jetbrains.com/display/TCD8/Setting+up+an+External+Database# Database: Microsoft SQL server (via jtds driver)   connectionUrl=jdbc:sqlserver://myServerName\\mySqlServerInstance:14330;databaseName=TeamCity# Note: the following two properties are *not* used in case of Integrated Authentication.connectionProperties.user=myUserconnectionProperties.password=myPassword# The maximum number of connections TeamCity can open on the database server.maxConnections=50# Specifies whether TeamCity should check each jdbc connection before use.# It reduces the system performance but avoids cases when the system uses# a connection that was closed by the database server due to a time-out or this# connection was broken during the previous operation.testOnBorrow=truewhere "myServerName" is the box name and "mySqlServerInstance" is the name of the sql server instance. The 14330 is not a typo, it is the port I have assigned.and, of course, myUser is the user and myPassword is the password (all of which have been substituted for what would be the real thing).The actual server name and instance names contain at least one dash character (-) if that makes a difference (it shouldn't but then again this should just work).The TC box is WS2012, Microsoft Firewall is shut off.I have tried the variants I can find via Google, nothing works.Any ideas what I'm missing here?
Sergey Pak JetBrains 323 posts since
Nov 13, 2013
Currently Being Moderated
Mar 19, 2014 4:30 PM in response to: Bruce Lackore
Re: Trying to evaluate TeamCity - can't connect to my SQL Server db

Unfortunately, your text is pretty bad formatted and I don't understand it.

Currently, there's an issue with MSSQL driver (http://youtrack.jetbrains.com/issue/TW-34987) that if you don't enter all properties correctly from the first time, it doesn't allow you to connect, until you restart TC.

Sergey Pak JetBrains 323 posts since
Nov 13, 2013
Currently Being Moderated
Mar 20, 2014 12:04 PM in response to: Bruce Lackore
Re: Trying to evaluate TeamCity - can't connect to my SQL Server db

what does it say in teamcity-server.log and catalina.out?

Kyle Jones Newbie 5 posts since
Jul 23, 2013
Currently Being Moderated
Mar 20, 2014 6:23 PM in response to: Bruce Lackore
Re: Trying to evaluate TeamCity - can't connect to my SQL Server db

We used the sqljdbc_4.0.2206.100_enu.exe driver dropping the sqljdbc_auth.dll into the TeamCity\jre\bin directory and the sqljdbc4.jar into ProgramData\JetBrains\TeamCity\lib\jdbc

 

The connection configuration was in the following location ProgramData\JetBrains\TeamCity\config\database.properties

# This is a sample configuration file for configuring TeamCity to use external database.

# To make it effective, copy it to the "database.properties" file and modify settings

# according to your environment.

# Do not modify this file, it will be overwritten on TeamCity server startup.

# See documentation at http://www.jetbrains.net/confluence/display/TCD5/Setting+up+an+External+Database

 

# Database: Microsoft SQL server (via jtds driver)  

 

connectionUrl=jdbc:sqlserver://SERVERNAME;databaseName=TeamCity;integratedSecurity=true

#connectionProperties.user=<username>

#connectionProperties.password=<password>

 

# The maximum number of connections TeamCity can open on database server.

maxConnections=50

 

# Specifies whether TeamCity should check each jdbc connection before use.

# It reduces the system performace but avoids cases when the system uses

# a connection that was closed by database server due to time out or this

# connection was broken at the previous operation.

testOnBorrow=true

 

This setup worked for us.

 

 

More Like This

  • Retrieving data ...