In order to post questions, answers, or comments, you now need a validated email address. Details on how to validate your address are in the FAQ.

What's the real difference between this 2 connection parameter?

asked Nov 10 '09 at 11:00

Zote's gravatar image

Zote
1.7k364050

edited Nov 15 '09 at 10:54

Breck%20Carter's gravatar image

Breck Carter
19.5k303454650


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=11.0.1.2276;
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 Nov 10 '09 at 14:07

Breck%20Carter's gravatar image

Breck Carter
19.5k303454650

Your answer
toggle preview

Are you providing an answer to the original question, or making a comment on the question or an answer? If you are making a comment please do not post a new answer. Click "Add new comment" on the question or answer instead. If you are responding to a previous comment, click on the "reply" icon (    ) for that comment.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link: [text](http://url.com/ "title")
  • image: ![alt text](/path/img.jpg "title")
  • numbered list (indent for sublists):
    1. Foo
    2. Bar
  • bullet list (indent for sublists):
    * Foo
    * Bar
  • to add a line break, add two spaces to where you would like the new line to be.
  • Code blocks should be indented by 4 spaces. SQL code should begin with ":::SQL" on the first line.
  • basic HTML tags are also supported

Tags:

×98
×28
×12

Asked: Nov 10 '09 at 11:00

Seen: 711 times

Last updated: Nov 15 '09 at 10:54

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link: [text](http://url.com/ "title")
  • image: ![alt text](/path/img.jpg "title")
  • numbered list (indent for sublists):
    1. Foo
    2. Bar
  • bullet list (indent for sublists):
    * Foo
    * Bar
  • to add a line break, add two spaces to where you would like the new line to be.
  • Code blocks should be indented by 4 spaces. SQL code should begin with ":::SQL" on the first line.
  • basic HTML tags are also supported