Bu Blogda Ara

21 Mart 2012 Çarşamba

JDBC Connection of SQL Server Name Instance

  • You should find port number of name instance.


Run Script on name instance.
DECLARE @tcp_port nvarchar(5)
EXEC xp_regread
@rootkey    =    'HKEY_LOCAL_MACHINE',
@value_name    =    'TcpPort',
@value        =    @tcp_port OUTPUT
select @tcp_port

  • Then you can connect like that:

To use a port number, do the following:
jdbc:sqlserver://<database_server_name>:<name_instance_port>;integratedSecurity=true;<more properties as required>;
To use a JDBC URL property, do the following:
jdbc:sqlserver://localhost;instanceName=instance1;integratedSecurity=true;<more properties as required>;

Hiç yorum yok:

Yorum Gönder