using JDBC driver
JDBC is for Java applications; MS SQL Server isn't one.
You have to use ODBC or OleDB instead; see Linked Servers (Database Engine)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
HI All ,
I have created a linked server in Management studio. When I tried to to query linked server using JDBC driver then error got popped "**No login mappings exists**". But same thing working in Management studio.. The JDBC url I am using is
jdbc:sqlserver://<Host>:1433;Databasename=Database11;selectMethod=cursor;authenticationScheme=NTLM;Domain=<Domain>;IntegratedSecurity=true
User name and password I have tried with Active directory credentials. Is there any possibility to pass login mappings through JDBC url.
Thanks in Advance,
using JDBC driver
JDBC is for Java applications; MS SQL Server isn't one.
You have to use ODBC or OleDB instead; see Linked Servers (Database Engine)
The error message suggest that when you set up the linked server, you did not set up self-mapping, and then you only set up login mapping for some accounts.
By default, when you create a linked server by saying:
EXEC sp_addlinkedserver THATSERVEROVERTHERE
You will get self-mapping. This means that users who are logged on the local server, will access THATSERVEROVERTHERE with the same credentials as they when logged in on the local server. This is also desirable, as there are no security issues here.
However, this does not always work out for various reasons, for instance the users has no login on their own on the remote server. In that case you can set up login mapping, so that the access to the remote server is by a specific SQL login. This mapping can be setup for everyone (not good for security!) or only for specific users.
The fact that you log on through JDBC has nothing to do with it as such. But it does not matter how the Java program log on.
Hi @Narayana Chirravuri ,
No Login-mapping Exists
You can check SQL Server account you use, if it is not a valid login or you do not have permission, maybe you should provide this user in the connection string, such as:
EXEC master.dbo.sp_addlinkedserver @server = N'ONE', @srvproduct=N'SQL', @provider=N'SQLNCLI11', @datasrc=N'SQLSERVER-1', @provstr=N'Data Source=SQLSERVER-1;User ID=user
Or if you do not want to map any logins with aspecific SQL Serve account, you can select the security context
EXEC sp_addlinkedsrvlogin 'TEST1', 'false', 'userLocal', 'userRemote', 'remotePassword'
https://www.databasejournal.com/ms-sql/linked-severs-on-ms-sql-part-3/