MS SQL Express/JDBC
So, I downloaded and installed MS SQL Express and its JDBC. Everything compiles and runs sortof correctly... but it can't connect to the database. As far as I can tell, it should allow TCP/IP connections to be made to the database, but no luck at all. The error I get (roughly translated) is:
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 failed. Error: "Connection refused: connect. Verify the connection properties. Make sure an instance of the SQL Server is running on the host and is accepting TCP/IP connections on the port and that any firewall allows traffic on the port."
Anyone familiar enough with MS SQL that can help me make sure the settings are okay? I can connect to the database through the tools distributed with the database, so I know that's up and running at least.
EDIT: Or if anyone can find a fault with the first three lines of code in my program:
Connection con=DriverManager.getConnection(url, "user", "pass");
(and no, they're not actually called "user" and "pass", but it doesn't even seem to get far enough to check those). I've tried specifying port 1433 as well (standard port and whatnot), but no luck.
Re: MS SQL Express/JDBC
Well, managed to solve it on my own... First, it actually needed an instance-name at the end of the URL (so it became jdbc:sqlserver://localhost\\SQLEXPRESS). It wasn't optional, as the documentation said it was. When that was added, I got another piece of text in the error message: "Make sure the service SQL Server Browser is running on the host computer"... which, of course, it wasn't. Activate that one, and it at least connected. Now to solve all the syntax errors in the SQL statements. Apparently MS SQL doesn't use the same syntax as MySQL does...