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

Поиск
Список
Период
Сортировка
От Sehrope Sarkuni
Тема Re: [***] Re: Set application name from jdbc url
Дата
Msg-id CAH7T-ary4X3S+B2myBOBrrjcnhLqLSLUiJA2poEP5USUJwbuKw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [***] Re: Set application name from jdbc url  (Stéphan BEUZE <stephan.beuze@douane.finances.gouv.fr>)
Ответы Re: [***] Re: Set application name from jdbc url
Список pgsql-jdbc
Try it with the latest version of the JDBC driver (currently
9.2-1003-jdbc4). Maybe your older driver is causing the issue (above
says you're using v9.1-904).

I'm able to test setting the client name and verify it via
pg_stat_activity using the latest driver connecting to 9.1, 9.2, and
9.3. I tried it via a URL property, setClientInfo(...), and explicitly
setting a java.util.Property value and all three worked fine.

-S

On Thu, Oct 17, 2013 at 10:11 AM, Stéphan BEUZE
<stephan.beuze@douane.finances.gouv.fr> wrote:
> 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
>
>
>


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Stéphan BEUZE
Дата:
Сообщение: Re: [***] Re: Set application name from jdbc url
Следующее
От: Stéphan BEUZE
Дата:
Сообщение: Re: [***] Re: Set application name from jdbc url