From: | Sehrope Sarkuni <sehrope(at)jackdb(dot)com> |
---|---|
To: | Stéphan BEUZE <stephan(dot)beuze(at)douane(dot)finances(dot)gouv(dot)fr> |
Cc: | List <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: [***] Re: Set application name from jdbc url |
Date: | 2013-10-17 14:54:57 |
Message-ID: | CAH7T-ary4X3S+B2myBOBrrjcnhLqLSLUiJA2poEP5USUJwbuKw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(dot)beuze(at)douane(dot)finances(dot)gouv(dot)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
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Stéphan BEUZE | 2013-10-18 11:12:29 | Re: [***] Re: Set application name from jdbc url |
Previous Message | Stéphan BEUZE | 2013-10-17 14:11:17 | Re: [***] Re: Set application name from jdbc url |