 |
|
 |
 |
|
 |
 |
| Author |
Message |
|
|
|
Post subject: jdbc connection to sql server
Posted: Nov 24, 2006 - 04:48 AM
|
|

Joined: Nov 24, 2006
Posts: 2
|
|
when 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 |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 24, 2006 - 06:13 AM
|
|
Moderator


Joined: Feb 03, 2006
Posts: 1117
|
|
ankisettyk,
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 class
If this doesn't help, please send us more details :
- your jdbc driver and version
- driver info : class name
- connection profile info : URL
Regards, |
_________________ Peco
MyEclipse Support
Please do us a big favor and remember to vote for MyEclipse at the JDJ Reader's Choice Awards.
We really appreciate it!
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 27, 2006 - 07:13 AM
|
|

Joined: Nov 24, 2006
Posts: 2
|
|
i 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"; |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Nov 29, 2006 - 11:55 AM
|
|
Moderator


Joined: Feb 03, 2006
Posts: 1117
|
|
ankisettyk,
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, |
_________________ Peco
MyEclipse Support
Please do us a big favor and remember to vote for MyEclipse at the JDJ Reader's Choice Awards.
We really appreciate it!
|
| |
|
|
|
 |
|
|
| |
|
|
 |
|
 |
|
|
|
 |