- This topic has 3 replies, 2 voices, and was last updated 17 years, 11 months ago by Haris Peco.
-
AuthorPosts
-
ankisettykMemberwhen i am trying to establish a jdbc connection with sql server 2005, am getting error as
The Tcp/Ip connection to the host has failed. java.net.Connect Exception:
Connection refused:connect
Haris PecoMemberankisettyk,
Please, check next :
– if your database enabled for tcp/ip access (it is not default enabled for sql server)
– is your correct URL (host and port name)
– you set correct sql server jdbc driver (there are microsoft jdbc driver and open source jTDS driver) and driver classIf this doesn’t help, please send us more details :
– your jdbc driver and version
– driver info : class name
– connection profile info : URLRegards,
ankisettykMemberi tried to enable my database for tcp ip access, it is generating the following error
an error has occured while establishing a connection to the server.when connecting to the sqlserver 2005,
this failure may be caused by the fact that under the default settings SQL server doesnot allow remote connections.(Microsoft SQL server,Error :10060)am using the following driver
jdbc driver –sqljdbc.jar(sqljdbc _1.1)
class name — Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver”);
URL—String connectionUrl = “jdbc:sqlserver://localhost:1433;” +
“databaseName=AdventureWorks;user=sa;password=bootay”;
Haris PecoMemberankisettyk,
Try set TCP/IP with SQL Server Configuration Manager
– expand ‘SQL server 2005 Network’ configration and click on ‘Protocols to MSSQL Server’
– right click on TCP/IP and choose ‘Enable’
– in Properties dialog choose IP adresses and set TCP/IP port to 1433 (or what you want, but this is port in your URL).Set Enable to Yes.
– restart SQL Server
– Your server have be install in mixed mode (I supposet that it is default on SQL Server Express)Sorry for delay
Regards,
-
AuthorPosts