1

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.

Roman
  • 197
  • 3
  • 6
  • 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 08 '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 08 '10 at 17:49

2 Answers2

2

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.

Glorfindel
  • 1,213
  • 3
  • 15
  • 22
K. Brian Kelley
  • 9,004
  • 31
  • 33
1

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"

Kedare
  • 1,766
  • 4
  • 20
  • 36
  • 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 08 '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 08 '10 at 17:15