How to set application name in a Postgresql JDBC url? -


i want set application name of connections of application. when list rows in pg_stat_activity can have non empty application_name column.

i have setup following jdbc url connecting postgresql database:

jdbc:postgresql://localhost:5435/mydb?application-name=myapp 

i have tried url no more success.

jdbc:postgresql://localhost:5435/mydb?application_name=myapp 

what correct parameter name ?

here jdbc driver version: 9.1-901.jdbc4

looking @ postgresql jdbc 9.1 documentation, connection parameters, correct property name in jdbc url applicationname:

applicationname = string

specifies name of application using connection. allows database administrator see applications connected server , resources using through views pg_stat_activity

so try:

jdbc:postgresql://localhost:5435/mydb?applicationname=myapp 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -