I've installed SQL Server 2008 Express.

I connected to it and created a Database with Microsoft SQL Management Studio.

But I cannot connect (with same url, username and password) to the DB from my java application.

Any ideas?

Thanks in advance.

  • Also a note, SQL Server Express will not accept connections from remote computers. Even if you enable the TCP/IP Protocol, the connecting address must be from a local IP. – Chris S Jul 8 '10 at 17:30
  • SQL Server Express, by default, does not allow remote connections. However, it can receive remote connections just fine. – K. Brian Kelley Jul 8 '10 at 17:49

This blog post details all the steps you need to go through to ensure you can connect to SQL Server Express remotely. While the post is for Vista, it's applicable to the server operating systems as well. One thing you'll probably want to do to isolate where the issue is with respect to connecting is to use ODBC Data Sources from a remote server and see if you can establish a connection once you've done all the configuration work. If you can, then SQL Server Express is set up properly and it's a matter of getting the Java app configured correctly.


Take a look on your Windows Start Menu, you must have some programs about Microsoft SQL Server, you must enable the "TCP/IP Protocol" in the "SQL Server Configuration Manager"

  • done. Now I need to add it to allow-list in windows firewall. But I cannot find sqlserv.exe. What are the exe-file names which I should add to allow-list? – Roman Jul 8 '10 at 17:05
  • The server .exe should be something like this: "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\Sqlservr.exe" (depending of your architecture, instance name and your version) – Kedare Jul 8 '10 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.