Re: [***] Re: Set application name from jdbc url

From: Stéphan BEUZE <stephan(dot)beuze(at)douane(dot)finances(dot)gouv(dot)fr>
To: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [***] Re: Set application name from jdbc url
Date: 2013-10-17 14:11:17
Message-ID: 525FF005.9090206@douane.finances.gouv.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

The solution from [2] works like a charm.

However, the solution from [1] doesn't work :\

I have set up a database connection from the Datasource explorer in Eclipse,
with the following JDBC url:

jdbc:postgresql://localhost:5435/REC?ApplicationName=ZOZOZOZ

From pgAdmin III, here are the results of the following query : select
pid, application_name from pg_stat_activity

9212;""
6396;""
4628;"psql"
6796;"pgAdmin III - Navigateur"

The results of the same query running from psql:

pid | application_name
------+-------------------------------------
9212 |
6396 |
4628 | psql
6796 | pgAdmin III - Navigateur

I have tried to set up a connection manually and I get the same similar
results: ZOZOZOZ seems to be an unknown application name.

Le 17/10/2013 15:44, Sehrope Sarkuni a écrit :
>> What is the correct parameter name ?
> Try "ApplicationName" [1]. Also, you can set it on the Connection
> object after creation via the JDBC standard setClientInfo(...)
> method[2].
>
> [1]: https://github.com/pgjdbc/pgjdbc/blob/master/org/postgresql/core/v3/ConnectionFactoryImpl.java#L639
> [2]: http://docs.oracle.com/javase/7/docs/api/java/sql/Connection.html#setClientInfo%28java.lang.String,%20java.lang.String%29
>
> -S

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Sehrope Sarkuni 2013-10-17 14:54:57 Re: [***] Re: Set application name from jdbc url
Previous Message Sehrope Sarkuni 2013-10-17 13:44:50 Re: Set application name from jdbc url