0

I have been so far using jtds driver for sqlserver using the following connection string.

jdbc:jtds:sqlserver://hostname:15001;databaseName=MYDB1;useNTLMv2=true;domain=CORP;

Note that database is using windows authentication. However the domain, username and password will be supplied.

However jtds driver had some issues saving in varchar(MAX) field using hibernate. Hence decided to switch to Microsoft's sqljdbc4.jar driver.

I have tried the format using "Integrated Security=true;" however it uses the logged in user where the application is running. I am not able to specify a different domain and user.

Is there a solution for this?

gpothan
  • 151
  • 7
  • "*It uses the logged in user in the database server*" - it uses the logged in user of the computer _where you are running your Java application_. If that happens to be the DB server in your case, then you are right. –  Oct 01 '15 at 15:05
  • @a_horse_with_no_name - Thanks for the correction. So it would use the credentials where my application is running. Even that is not enough - I need to supply a different user. – gpothan Oct 01 '15 at 15:31
  • Then you can't use windows authentication. The whole idea behind Windows authentication **is** that the operating system already did the authentication. If you could specify any user, this would defeat that purpose. –  Oct 01 '15 at 16:06

0 Answers0