Feedback
Did this article resolve your question/issue?

   

Article

setClientInfo("ApplicationName") is not setting information to master..sysprocesses table with Connect for JDBC SQL Server driver

Information

 
TitlesetClientInfo("ApplicationName") is not setting information to master..sysprocesses table with Connect for JDBC SQL Server driver
URL Namesetclientinfo-applicationname-is-not-setting-information-to-master-sysprocesses-table-with-connect-for-jdbc-sql-server-driver
Article Number000182527
EnvironmentProduct: Connect for JDBC SQL Server
Version: 5.1
OS: Java
Database: SQL Server
Application: All supported applications
Question/Problem Description
When setting Client Information with the Connection.setClientInfo("ApplicationName") method, the information is not set in the master..sysprocesses table.
Steps to Reproduce
Clarifying Information
Code snippet :
properties.setProperty("ApplicationName", "testApp");
Connection.setClientInfo(properties);
or
Connection.setClientInfo("ApplicationName", "testApp");
...
ResultSet rs = stmt.executeQuery("SELECT program_name FROM master..sysprocesses WHERE spid=@@spid");
=> this will return an empty resultset
Error Message
Defect Number
Enhancement Number
Cause
SQL Server does not have an option to set the ApplicationName after a connection is established. Therefore when using Connection.setClientInfo(), the Client Info is set after connection and is only available through Connection.getClientInfo("ApplicationName").
Resolution
This is expected behavior.

Use Connection.getClientInfo("ApplicationName").
Workaround
Use Connection Option "ApplicationName" to set Application Name Client Information at connection time.
Notes
Last Modified Date11/18/2015 8:39 AM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.