2

Is it possible to use the windows authentication mode for SQL SERVER database, while using the micro soft provided JDBC drivers?

I am using sqljdbc.jar.. the SQLJdbcVersion class file contains this:

  static final int major = 2;
  static final int minor = 0;
  static final int MMDD = 1803;
  static final int revision = 100;

Any comments?

Is there a reason why sqljdbc can not use windows authentication?

I am using Websphere application server 7 and running a j2ee application. The datasources are created in the WAS itself.

Thanks

Ayusman
  • 8,509
  • 21
  • 79
  • 132

4 Answers4

2

On the datasource there is a rarely used link for "Custom Properties". On this page one of the custom properties is integrated_security which defaults to false. Change it's value to true.

Integrated Security Screen Shot

You must also have the "sqljdbc_auth.dll" file on your lib path, as several other questions mention. We put it in the same folder as the jar, and point the Websphere instance to that path on as the native library path (on the provider configuration screen).

C. Ross
  • 31,137
  • 42
  • 147
  • 238
2

Yes you can use windows authentication with JDBC driver provided by Microsoft

jdbc:sqlserver{HOST};Database={DB_NAME};integratedSecurity=true

Dhananjay
  • 3,903
  • 2
  • 29
  • 44
  • this is good. But can I use this in configuring a datasource in WAS. I don't get to provide this kind of URL while creating a datasource in WAS. Any pointers? – Ayusman Aug 05 '11 at 07:33
  • Does the datasource creation requires the auth file : "sqljdbc_auth.dll" in the class path? What if my Websphere server is running on a AIX box? Should I still use the dll file? – Ayusman Aug 05 '11 at 08:07
  • 1 .Can you check for setting custom properties on datasource creation in websphere admin console, (I guess you can add key value pairs) – Dhananjay Aug 05 '11 at 09:16
  • 2. add sqljdbc_auth.dll to jdk/bin or jre/bin – Dhananjay Aug 05 '11 at 09:22
2

It is possible, but only if you are running in a Windows environment since the integratedSecurity=true requires access to sqljdbc_auth.dll. To my knowledge, this native library has not been ported to any other platform. For obvious reasons, since it uses the windows credentials the jvm process is running under to authenticate against SQL Server.

The dll should not be on the class path, but on the java library path. Easiest way is to copy the sqljdbc_auth.dll to the [jre]\bin folder.

pap
  • 27,064
  • 6
  • 41
  • 46
-1

you can use springjdbc.jar only if you jre is less than 1.7

otherwise you have to use springjdbc4.jar and this does not support integrated authentication

Mohammed Rafeeq
  • 2,586
  • 25
  • 26