I am using sql server 2008 and jtds driver to establish a connection between sql server and the jsp application. I code i used is
java.sql.SQLException: Network error IOException: Connection refused: connect
String url= "jdbc:jtds:sqlserver://127.0.0.1/sfts";
String id= "sfts";
String pass = "sfts";
try{
Class.forName("net.sourceforge.jtds.jdbc.Driver");
con = java.sql.DriverManager.getConnection(url, id, pass);
}catch(Exception e){
out.println(e);
}
While running this code, it showing error as
java.sql.SQLException: Network error IOException: Connection refused: connect
TCP/IP was set enabled and port number was set to 1433. But still it is showing this error.. What to do now??
Goto AllProgram->SQL Server 2008->configuraton tools->SQL Server Configuration Manager->SQL Server Network Configuration-> Select your server instance and right click on TCP/IP then goto IPAddresses. Change/Place port number for all IP's as 1433. Save it and restart the server. It Should solve your problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With