It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Java Forum

connection problem with mssql sp4

connection problem with mssql sp4

Postby curioushard on Tue Dec 12, 2006 5:40 am

hi
i m using this code to connect to
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection("jdbc:sqlserver://"+
"localhost:1433;databaseName=dbcheck;",
"sa","");


and i m recieving the exception of Connection refused with exception

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at DbCheck.<init>(DbCheck.java:15)
at DbCheck.main(DbCheck.java:45)
java.lang.NullPointerException
at DbCheck.fun(DbCheck.java:28)
at DbCheck.main(DbCheck.java:46)
Exception in thread "main"
curioushard
 
Posts: 0
Joined: Tue Dec 12, 2006 5:34 am
Location: Lahore Pakistan

Who is online

Users browsing this forum: No registered users and 1 guest