Does anyone know how to get named instances to work, or, are they even supported?
The following doesn't work, it produces: Exception: Failed to establish a database connection. Check connection string, username and password.
var conn = Jdbc.getConnection("jdbc:sqlserver://myserver.com\\SQLEXPRESS;databaseName=MyDatabase;","MyUser","MyPassword")
The following works (given that 61570 is the port assigned to the instance SQLEXPRESS):
var conn = Jdbc.getConnection("jdbc:sqlserver://myserver.com:61570;databaseName=MyDatabase;","MyUser","MyPassword")
As far as I am aware, when you specify a named instance, there is some hand-shaking behind the scenes that normally happens:
- Contact the server and get the port for the named instance.
- Establish a connection with the returned port.