Migrating to MSSQL: Could not find JDBC driver class: net.sourceforge.jtds.jdbc.Driver

Hello,

I am trying to migrate my TC database to SQL Server 2008 using command:

c:\TeamCity\bin>maintainDB.cmd migrate -T database.properties.dist

The contents of the database.properties.dist file:

# Database: MSSQL

driverName=net.sourceforge.jtds.jdbc.Driver
connectionUrl=jdbc:jtds:sqlserver://mssql01/TeamCity
connectionProperties.user=username
connectionProperties.password=password


I have placed a copy of jtds-1.2.2.jar int the folder C:\TeamCity\webapps\ROOT\WEB-INF\lib

My PATH env variable includes "C:\TeamCity\jre\bin"

When I run the maintainDB.cmd tool I get the following output:

TeamCity maintenance tool. (C) 2000-2009 JetBrains s.r.o.

Using TeamCity data directory: C:\TeamCity\.BuildServer
Using internal database.
Using source database
        database type: HSQLDB
        database driver: org.hsqldb.jdbcDriver
        connection: jdbc:hsqldb:file:C:/TeamCity/.BuildServer/system/buildserver
        login as: <empty>
Connected to the Source DB successfully.
Using explicitly specified target database settings: c:\TeamCity\bin\database.properties.dist
Using target database
        database type: MSSQL2005
        database driver: net.sourceforge.jtds.jdbc.Driver
        connection: jdbc:jtds:sqlserver://mssql01/TeamCity
        login as: username
Failed: Could not find JDBC driver class: net.sourceforge.jtds.jdbc.Driver

jetbrains.buildServer.serverSide.DatabaseMissException: Could not find JDBC driver class: net.sourceforge.jtds.jdbc.Driv
er
        at jetbrains.buildServer.serverSide.impl.DBFacade.checkDriverClass(DBFacade.java:245)
        at jetbrains.buildServer.serverSide.impl.DBFacade.createDataSource(DBFacade.java:330)
        at jetbrains.buildServer.serverSide.impl.DBFacade.<init>(DBFacade.java:312)
        at jetbrains.buildServer.serverSide.dbbackworks.BackupRestoreRunner.ensureTargetDB(BackupRestoreRunner.java:120)

        at jetbrains.buildServer.serverSide.dbbackworks.BackupRestoreRunner.mainMain(BackupRestoreRunner.java:144)
        at jetbrains.buildServer.serverSide.dbbackworks.BackupRestoreRunner.main(BackupRestoreRunner.java:96)
Done.


I am not that familiar with Java, can someone point me in a direction to solve this?

Many thanks.

3 comments
Comment actions Permalink

I forgot to mention - TeamCity 5.0 EAP build 10522

0
Comment actions Permalink

Damian,

could you please ensure that the properties file doesn't contain spaces at string ends.
Strings must not have tailing spaces.

--
Leonid

0
Comment actions Permalink

Oh FFS  **face-palm**... that was it. That simple. I feel ashamed now.

Thanks!

0

Please sign in to leave a comment.