jTDS から Microsoft の JDBC ドライバへの切り替え

Bitbucket を SQL Server に接続する

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

このページでは、Microsoft SQL Sever へのアクセスに使用するドライバを jTDS から Microsoft SQL Server jDBC に変更する方法について説明します。

必要な操作について

If Bitbucket Data Center and Server was configured to use Microsoft SQL Server by following the steps outlined in Connect Bitbucket to SQL Server no change is necessary. However, if Bitbucket was configured to use Microsoft SQL Server by manually entering a JDBC URL, the system will lock on startup if the driver class and URL are not manually updated.

手順

In the home directory, bitbucket.properties must be edited to change the JDBC driver and URL. The existing configuration should look similar to this:

jdbc.driver=net.sourceforge.jtds.jdbc.Driver
jdbc.url=jdbc:jtds:sqlserver://localhost:1433;databaseName=stash;
jdbc.user=stashuser
jdbc.password=secretpassword

(warning) The JDBC URL above is in the format constructed by Bitbucket when connecting Bitbucket to SQL Server and will automatically be updated to a URL compatible with Microsoft's driver, with no change required on the administrator's part.  If the URL contains additional properties, such as domain=, it will need to be manually updated.

Microsoft の SQL Server ドライバを使用するには、上記の設定を次のように更新します。

jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://localhost:1433;databaseName=stash;
jdbc.user=stashuser
jdbc.password=secretpassword

新しい URL で使用する正確な値はこのドキュメントの範囲外であり、置き換える jTDS 設定に基づいて選択する必要があります。

追加情報

The new JDBC driver class is: com.microsoft.sqlserver.jdbc.SQLServerDriver

jTDS ドライバの JDBC URL 形式は SourceForge (http://jtds.sourceforge.net/faq.html#urlFormat) のドキュメントに記載されています。

Microsoft の SQL Serverドライバの jDBC URL 形式は MSDN (http://msdn.microsoft.com/en-us/library/ms378428.aspx) に、追加プロパティのドキュメントは http://msdn.microsoft.com/en-us/library/ms378988.aspx に記載されています。

ドライバを変更する理由

ここをクリックしてすべての技術的な詳細を表示...

Recent releases of Hibernate, which Bitbucket uses to simplify its persistence layer, have introduced a requirement that the JDBC drivers and connection pools used be JDBC4-compliant. JDBC4 was introduced with Java 6.

The jTDS driver used by releases prior to Bitbucket 2.1 is a JDBC3 driver, compatible with Java 1.3, and therefore cannot be used with newer versions of Hibernate. While jTDS 1.3.0 and 1.3.1 claim to implement JDBC4, and JDBC4.1, they actually don't. The new methods have been "implemented", but their implementations are all throw new AbstractMethodError(), which means they can't actually be used. (See an example here, on GitHub.)

jTDS 1.3.1 は機能する JDBC4 実装を提供しないため、jTDS を Microsoft 独自の SQL Server ドライバに置き換えることを判断しました。Microsoft のドライバは積極的にメンテナンスされていますが、jTDS ドライバは 2014 年以降更新されていません (2014 に小規模の更新が行われる前は数年間更新されませんでした)。Microsoft は完全な JDBC4.2 (Java 8) ドライバを提供し、SQL Server のすべての機能 (SQL Server 2016 を含む) をサポートします。

Bitbucket attempts to automatically update jTDS JDBC URLs to values compatible with Microsoft's JDBC driver. However, for installations using custom JDBC URLs–for example, to use domain authentication–such automatic updating is not possible; the URL, which was manually entered, must be manually updated.

最終更新日: 2023 年 1 月 31 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.