Transitioning from jTDS to Microsoft's JDBC driver

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Crowd is bundled with the jTDS Driver for SQL Server but Crowd is also supported with the Microsoft JDBC Driver for SQL Server.

This page describes how to update Crowd from using the bundled jTDS Driver to using the Microsoft JDBC Driver to communicate with Microsoft SQL Server. Refer to the Crowd Supported Platforms for the supported versions of Microsoft SQL Server.

What do I have to do?

Follow these steps to switch an existing installation of Crowd from using the jTDS Driver to the Microsoft JDBC Driver.

If you are installing Crowd for the first time, install Crowd with the jTDS Driver and then follow these steps to switch over to the Microsoft JDBC Driver.

(lightbulb) Note that these steps have been verified with Crowd 3.4.x using the Microsoft JDBC Driver 6.3 JRE8 Preview bundled with Confluence.

Why change drivers?

  • If you see all the C3P0PooledConnectionPoolManager JTDS driver threads "block" trying to get a connection when SQL Server looks readily available for new connections:

    "C3P0PooledConnectionPoolManager[identityToken->1abcyea999ohuy3abcdef|123aca5e]-HelperThread-#2" #21 daemon prio=5 os_prio=0 tid=0x000000001b72a000 nid=0x2858 runnable [0x000000001eeee000]
       java.lang.Thread.State: RUNNABLE
        at Method)
        - eliminated <0x00000000ebf67698> (a
        - locked <0x00000000ebf67698> (a
        - locked <0x00000000ebf687e8> (a
        - locked <0x00000000ebf67640> (a
        at net.sourceforge.jtds.jdbc.MSSqlServerInfo.<init>(
        at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(
        at net.sourceforge.jtds.jdbc.Driver.connect(
        at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(
        at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(
        at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(
        at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(
        at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(
        at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(
        at com.mchange.v2.resourcepool.BasicResourcePool.access$800(
        at com.mchange.v2.resourcepool.BasicResourcePool$
        at com.mchange.v2.async.ThreadPoolAsynchronousRunner$

How to proceed

  1. Shutdown Crowd
  2. Download the Microsoft JDBC Driver 6.4 for SQL Server
    1. Extract the mssql-jdbc-6.4.x.jre8.jar from the downloaded file
    2. Copy the mssql-jdbc-6.4.x.jre8.jar into <crowd-install>/apache-tomcat/lib
  3. Backup <crowd-home>/shared/crowd.cfg.xml
  4. Edit <crowd-home>/shared/crowd.cfg.xml and update the JDBC driver string and URL.
    1. The existing jTDS configuration driver and connection string syntax should look similar to this:

          <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
          <property name="hibernate.connection.url">jdbc:jtds:sqlserver://localhost:1433/crowd</property
    2. Update the configuration to the Microsoft SQL Server Driver syntax:

          <property name="hibernate.connection.driver_class"></property>
          <property name="hibernate.connection.url">jdbc:sqlserver://;serverName=localhost;portNumber=1433;databaseName=crowd</property>
  5. Start Crowd

(lightbulb) Additional parameter values to use in the new URL are beyond the scope of this documentation; they should be chosen based on the jTDS settings they are replacing.

Additional Information for the curious

Last modified on May 27, 2019

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.