Has anyone used Scott's utility to connect to a MS SQL Server instance that has the same port number as another instance? I've requested a separate port number for the additional instance, but am still waiting on it.
Two SQL Server instances on one server:
SQLREP1 (default)
SQLREP1\MSSQL2008R2 (additional instance)
In these cases, both have the default port, 1433.
I've tried two different approaches.
1. Spell out the server-instance-database in the format it appears on this site:
http://msdn.microsoft.com/en-us/library/ms378428.aspx
serverDB = "SQLREP1// MSSQL2008R2/database"
(I also tried it as "SQLREP1/ MSSQL2008R2/database"
serverPath = 'jdbc:jtds:sqlserver://' + serverDB;
// Establish the connection to the server.
gConnection = JDBC_Connect( 'net.sourceforge.jtds.jdbc.Driver':
%trim( serverPath ): %trim( userid ):
%trim( password ) );
Exception in thread "main" java.sql.SQLException: Unknown server host name 'SQLREP1\\MSSQL2008R2'.
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:401)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
Caused by: java.net.UnknownHostException: SQLREP1\\MSSQL2008R2
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:207)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:377)
at java.net.Socket.connect(Socket.java:539)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:307)
at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:257)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:311)
... 1 more
2. I also tried using properties, while referencing the properities page
http://msdn.microsoft.com/en-us/library/ms378988.aspx
prop = JDBC_Properties();
JDBC_setProp(prop: 'userName': %trim( userID ) );
JDBC_setProp(prop: 'password': %trim( password ) );
// Set the instance
If instance <> *blanks;
JDBC_setProp(prop: 'instanceName': %trim( instance ) );
EndIf;
// Set the database
If db <> *blanks;
JDBC_setProp(prop: 'databaseName': %trim( db ) );
EndIf;
Address = 'SQLREP1';
gConnection = JDBC_ConnProp( 'net.sourceforge.jtds.jdbc.Driver':
'jdbc:jtds:sqlserver://' + %trim( address ):
prop );
JDBC_freeProp( prop );
The java error for this (note: the userid and password both have legit values):
Exception in thread "main" java.sql.SQLException: Single-Sign-On is only supported on Windows. Please specify a user name.
at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1878)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:588)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:345)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
Thanks,
Kurt Anderson
Sr. Programmer/Analyst
CustomCall Data Systems
As an Amazon Associate we earn from qualifying purchases.