From cf5c04427bae9a7808496ae1d26dce53bc8f8ceb Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 8 Oct 2021 10:12:52 +0200 Subject: [PATCH] IDEMPIERE-4991 Identify iDempiere JDBC connections in DBeaver or other session administration software (#913) --- .../src/org/compiere/db/DB_Oracle.java | 1 + .../src/org/compiere/db/DB_PostgreSQL.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java b/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java index 6e280037df..f6fd3858af 100644 --- a/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java +++ b/org.compiere.db.oracle.provider/src/org/compiere/db/DB_Oracle.java @@ -204,6 +204,7 @@ public class DB_Oracle implements AdempiereDatabase */ public String getConnectionURL (CConnection connection) { + System.setProperty("oracle.jdbc.v$session.program", "iDempiere"); StringBuilder sb = null; // Server Connections (bequeath) if (connection.isBequeath()) diff --git a/org.compiere.db.postgresql.provider/src/org/compiere/db/DB_PostgreSQL.java b/org.compiere.db.postgresql.provider/src/org/compiere/db/DB_PostgreSQL.java index c7be07a2b7..6e6c6ace59 100755 --- a/org.compiere.db.postgresql.provider/src/org/compiere/db/DB_PostgreSQL.java +++ b/org.compiere.db.postgresql.provider/src/org/compiere/db/DB_PostgreSQL.java @@ -209,7 +209,7 @@ public class DB_PostgreSQL implements AdempiereDatabase .append(connection.getDbHost()) .append(":").append(connection.getDbPort()) .append("/").append(connection.getDbName()) - .append("?encoding=UNICODE"); + .append("?encoding=UNICODE&ApplicationName=iDempiere"); String urlParameters = System.getProperty("org.idempiere.postgresql.URLParameters"); if (!Util.isEmpty(urlParameters)) {