Reputation: 3085
I am trying to connect mssql server 2008 using jdbc connection. My connection url is like
jdbc:jtds:sqlserver://localhost:1433/dbname;user=username;password=password
However I get the above mentioned exception when I try to execute a stored procedure through prepared statement
I have enabled TCP/IP and Named pipes. I have disabled firewall.
What could be the issue.
I found out it was because the following error occurs "ole/db provider returned message login timeout expired"...
but not sure why this happens
Upvotes: 3
Views: 28764
Reputation: 31
I had the same problem, maybe the problem is related with DNS.
I fixed the problem creating the linked server with the IP Address instead of the server's name.
Upvotes: 1
Reputation: 3085
The linked server was configured with wrong authentication values. Hence when I tried to connect to the linked server it threw authentication exception which in turn throws above mentioned exception.
Creating a linked server with proper authentication values fixed the issue.
Upvotes: 4