0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

JDBCでSQL ServerにWindows認証でログインする。

Last updated at Posted at 2020-09-08

Windows認証用DLLを指定のフォルダに置く

djbcドライバダウンロードサイト

配置場所:C\Windows\System32\sqljdbc_auth.dll

・ダウンロード時はプロセッサアーキテクチャがファイル名含まれるため、リネームすること。
・x86、x64は自身のCPUと一致したdllを使用すること。

後述するが、厳密にはSystem32配下でなくともよい。

接続文字列にWindows認証を行うことを明記する。

jdbc:sqlserver://サーバ名:ポート番号;DatabaseName=DB名;IntegratedSecurity=true

よく出たエラーメッセージ

・このドライバーは、統合認証を行えるようには構成されていません。
・no sqljdbc_auth in java [dllを探したパスの一覧]

①sqljdbc_auth.dllが正常なパスに存在してない可能性が高い。
dllを探したパスの一覧のどこかに、dllが存在すればよい。
②存在しているのに解決しない場合、プロセッサアーキテクチャの一致していないdllを使用している可能性が高い。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?