Answered by:
Window Authentication Using JDBC

Question
-
Hi
We are Facing some issue while connecting from JAVA-JDBC program to SQL SERVER 2008 R2 DATABASE in Window Integrated Mode
SQL SERVER 2008 r2 is installed in ONE Server and we are trying connect from ANOTHER Machine using "JAVA-JDBC" type IV Driver. It is taking Windows authentication(Credentials of ANOTHER Machine) to SQL SERVER 2008 r2 to Connect
Is there any way where we can authenticate like SQL authentication in Windows Authentication instead using windows user credentials? or By Passing the Window Credentials while Authenticate to Database using Windows Authentication.
Please Help.
Thanks,
Mamidi
Wednesday, April 27, 2016 7:41 PM
Answers
-
Hi Mamidi,
According to my knowledge, it is not possible to bypass your local windows credentials to access SQL Server 2008 and use windows authentication in JDBC code. Please switch to SQL authentication and specify user account & password in the connection string.
Thanks,
Lydia ZhangLydia Zhang
TechNet Community Support- Proposed as answer by Lydia ZhangMicrosoft contingent staff Thursday, May 5, 2016 11:50 AM
- Marked as answer by Lydia ZhangMicrosoft contingent staff Monday, May 9, 2016 2:06 AM
Friday, April 29, 2016 7:30 AM
All replies
-
Hi Venkat,
Not pretty sure on what your scenario is? However just adding that Windows login to the SQL Server with appropriate permissions to the databases needed should fix your issue and by leaving the connections strings to default with the windows authentication.
Is there any way where we can authenticate like SQL authentication in Windows Authentication instead using windows user credentials? or By Passing the Window Credentials while Authenticate to Database using Windows Authentication.
Nope. This is not possible.
Also see this link for some connection examples jdbc
https://msdn.microsoft.com/en-us/library/ms378428%28v=sql.110%29.aspx?f=255&MSPPError=-2147217396
Hope this helps
Thanks
Bhanu
- Edited by bhanu_nz Wednesday, April 27, 2016 9:24 PM
Wednesday, April 27, 2016 9:21 PM -
Hi Bhanu,
Thanks for response.
iam connecting sqlserver 2008 R2 from "local system" using JDBC Connection (windows authentication) using
IntegratedSecurity="true" . What is happenning is it is taking my local machine windows credentials i.e domainname\xyz to authentication. Here i want to bypass by Local Machine Windows Credentials
since my Windows Credentials dont have permision to access the Sql server 2008 that why it is not connecting to the sql server
i want to bypass my local windows credentials to access sqlserver 2008 r2 from local machine similarly as sqlauthentication using windows authentication(integratedSecurity=true) is there any way in jdbc code ?
Thanks,
Mamidi
Thursday, April 28, 2016 3:22 AM -
Hi Mamidi,
According to my knowledge, it is not possible to bypass your local windows credentials to access SQL Server 2008 and use windows authentication in JDBC code. Please switch to SQL authentication and specify user account & password in the connection string.
Thanks,
Lydia ZhangLydia Zhang
TechNet Community Support- Proposed as answer by Lydia ZhangMicrosoft contingent staff Thursday, May 5, 2016 11:50 AM
- Marked as answer by Lydia ZhangMicrosoft contingent staff Monday, May 9, 2016 2:06 AM
Friday, April 29, 2016 7:30 AM