Vista and MSSQL 2008

I just put together a new server to run some tests, and am having a problem setting up the server connection. I’ve gone through everything I can think of, but still get the following error:

FAIL   (next test in 8 seconds)
Message:   (hide details)

Unable to get information from SQL Server: localhost.

Details:
SQLException
net.sourceforge.jtds.jdbc.MSSqlServerInfo.(MSSqlServerInfo.java:91)
net.sourceforge.jtds.jdbc.ConnectionJDBC2.(ConnectionJDBC2.java:263)
net.sourceforge.jtds.jdbc.ConnectionJDBC3.(ConnectionJDBC3.java:50)
net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
com.inductiveautomation.factorypmi.gateway.db.DatasourceManager$DSInfo.runTest(DatasourceManager.java:631)
com.inductiveautomation.factorypmi.gateway.db.DatasourceManager$FaultedDatasourceRetryer.run(DatasourceManager.java:468)
java.lang.Thread.run(Unknown Source)

This is a Vista Business 64 bit machine running SQL Server 2008 Express. I added 127.0.0.1 to the hosts file and I can ping localhost by name. In the connection properties, I am using “jdbc:jtds:sqlserver://localhost:1433/databasename” and have added “instance=SQLEXPRESS;” in the extra connection properties. I have gone over every properties page I could find and compared them with a working machine (XP PRO w/ 2005 Express) and can’t find any settings that are different. In the SQL Server Configuration Manager, I have TCPIP and NamedPipes enabled, and the default port is 1433. Everything looks ok.

This is my first experience with Vista and SQL 2008, and am obviously missing something. Ideas?

It’s always worth checking that a software firewall isn’t getting in the way. Trying turning it off and checking again. Can you connect to the database from a database client?

Al

I just tried turning the firewall off altogether, and get the same results.

I can connect to the database with Management Studio.

Here’s what I found on the documentation for the driver:

[quote]Why do I get a java.sql.SQLException: “Unable to get information from SQL Server” when trying to connect to an SQL Server instance?

The exception you are getting is usually caused by a timeout. When connecting to named instances jTDS needs to connect via UDP to port 1434 to get information about available SQL Server instances. While doing this it times out, throwing the exception you see (which means that jTDS was not able to get information about the running instances).

Connection timeouts occur when there is no server listening on the port (BTW, are you sure your SQL Server is configured to use TCP/IP and that you actually use named instances?).

On SQL Server 2005 the SQL Browser service must be running on the server host as the instance name lookup port UDP 1434 is hosted by this service on SQL Server 2005 rather than the SQL Server itself. The default install does not configure the SQL Browser service to start automatically so you must do it manually.[/quote]

SO, a few things come to mind. First and foremost, if you really have it set up to use port 1433, you might try simply removing the Instance statement so that it doesn’t try to look up the instance info. Or, if you really do want to use named instances, the service that runs on 1434 and provides the lookup may not be started (I believe it’s the “SQL Server Browser” service).

I guess start by checking that service, and then try removing the instance name. If that doesn’t help… well, we’ll just have to try harder.

Regards,

Well, I checked the SQL Browser service, and it wasn’t running. I set the “Log On” to “This Account” and now it’s working. On my SQL 2005 machines, the Log On is set to “Built In Account”, but I know I never set that. Maybe 2008 requires you to explicitly set one or the other.

I’ll see if everything else works tomorrow, but at least the gateway status is “Valid” now. Maybe I’m just not very bright, but Vista is not my friend so far.

It's not just you, nearly everything is more complicated through the simple looking Vista interface.

I agree. Have you looked at the number of services running by default in Vista? The question is - will Windows 7 change this, or is it just putting (yet another) pretty face on internal workings far more complicated than XP?

Al