The SQL Anywhere engine initializes APP (or AppInfo) to a long string full of interesting and sometimes helpful information, whereas CON (or ConnectionName) starts out empty.
When you give values for APP and CON in your connection string, your APP value gets appended to the initial string, whereas your CON becomes the entire new value:
"%SQLANY11%\bin32\dbisql.com" -c "ENG=ddd11;DBN=ddd11;UID=dba;PWD=sql; CON=ddd11-3;APP=ASDFASF" SELECT CONNECTION_PROPERTY ( 'AppInfo' ), CONNECTION_PROPERTY ( 'Name' ); CONNECTION_PROPERTY('AppInfo'),CONNECTION_PROPERTY('Name') 'IP=192.168.1.105;HOST=PAVILION2;OSUSER=bcarter;OS=''Windows XP Build 2600 Service Pack 3'';EXE=''C:\\Program Files\\SQL Anywhere 11\\bin32\\dbisql.exe'';PID=0xbd4;THREAD=0xe08;VERSION=184.108.40.2066; API=iAnywhereJDBC;TIMEZONEADJUSTMENT=-300;APPINFO=ASDFASF','ddd11-3'
Personally, I haven't used APP much but I know people who do. However, I use CON all the time so I can tell connections apart, especially when every connection is using the same user id... not just connection pools, but a lot of classic embedded and other applications.
SQL Anywhere utilities, events and CREATE SERVICE web services set CON values; I don't have a complete list handy. Some of them are meaningful, some of them not so much: SQL_DBC_c657ef0
FWIW, the Foxhound database monitor does not display APP, either for its own connection or for any other connection, but it always shows CON... APP is on the future feature list but only as a "possible"... it takes up a lot of bandwidth for little (IMO) value, especially when you are monitoring 1000 connections. CON, on the other hand, can save your sanity.
BTW, that comment about bandwidth ONLY applies to Foxhound, not normal usage. And I think the built-in SQL Anywhere Monitor is the same but I would have to look.
Other than that, they might be the same: input parameters provided by the client side, available to application code via SELECT INTO, and to stored procedure logic via SELECT INTO or just simple function references: SET @variable = CONNECTION_PROPERTY ( 'AppInfo' );
answered 10 Nov '09, 14:07