0
votes

All,

I am trying to connect SQL Server named instance using Microsoft JDBC Driver as well as jTds.

Both were giving different problems .

Microsoft Driver issue :

Connection URL :

dataSource.setUrl("jdbc:sqlserver://xx.xx.xx.xx;databaseName=DBNAME;instanceName=SQL2005"); 

instance SQL2005 has failed. Error: java.net.SocketTimeoutException: Receive timed out. Verify the server and instance names, check that no firewall is blocking UDP traffic to port 1434, and for SQL Server 2005 or later verify that the SQL Server Browser Service is running on the host.

jTDS:

Connection url :

DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("net.sourceforge.jtds.jdbc.Driver");
dataSource.setUrl("jdbc:jtds:sqlserver://XX.XX.XX.XX:1434/DB_NAME;namedPipe=true;domain=dom");

pipe\sql\query (Logon failure: unknown user name or bad password)

Please give me a good solution to connect MS SQL SERVER NAMED INSTANCES using spring.

Thanks in advance

1
have you tried with namedPipe=false as you are accessing the server by TCP/IP - Stuart Blackler
i tried with namePipe=false , its throwing error "Logon failure: unknown user name or bad password." - user1032521

1 Answers

0
votes

Based on the error message, and the fact that it is missing from your code, you need to set user name and password somewhere too.

dataSource.setUser("db_username_here");
dataSource.setPassword("db_password_here");