Bu Blogda Ara

21 Mart 2012 Çarşamba

JDBC Connection of SQL Server Name Instance

  • You should find port number of name instance.

http://decipherinfosys.wordpress.com/2008/01/02/finding-the-port-number-for-a-particular-sql-server-instance/

Run Script on name instance.
DECLARE @tcp_port nvarchar(5)
EXEC xp_regread
@rootkey    =    'HKEY_LOCAL_MACHINE',
@key        =    'SOFTWARE\MICROSOFT\Microsoft SQL Server\<Name_Instance>\MSSQLSERVER\SUPERSOCKETNETLIB\TCP',
@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önderme