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?
5 comments

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.

0

"Badly Formatted" - yeah, I know. All my nice formatting went out the window when I hit submit. Sorry.

I have tried changing the properties, then stopping and restarting the service. Still does not connect.

0

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

0

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.

0

I ended up using the other (jdbc: jtds) driver. For some reason, that one worked without a hitch.

0

Please sign in to leave a comment.