Hi to all! I have SQL Server Express, SQL Server Management Studio 2012. My PC Name is : "SaboorPC" and SQL Server instance name is also "SaboorPC". I am trying to connect my Netbeans to My SQL Server but it is not connecting and giving the following error:
"com.microsoft.sqlserver.jdbc.SQLServerException: The connection to the host SABOORPC, named instance saboorpc failed. Error: "java.net.SocketTimeoutException: Receive timed out". Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434. For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host."
My code and connection url is as follows:
DriverManager.registerDriver(new com.microsoft.sqlserver.jdbc.SQLServerDriver());
String url ="jdbc:sqlserver://SABOORPC\\SaboorPC;databaseName = SampleDB;integratedSecurity = true;" ;
con = DriverManager.getConnection(url);
if(con!=null){
System.out.println("Connection established");
}
else{
System.out.println("Connection failed");
}
I am also pasting pictures of my pc name and SQL Server Name. Please guide me what I am doing wrong?