diff --git a/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBDriverBase.java b/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBDriverBase.java
index 315f270..46f9705 100644
--- a/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBDriverBase.java
+++ b/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBDriverBase.java
@@ -27,6 +27,7 @@
 import java.sql.DriverPropertyInfo;
 import java.sql.SQLException;
 import java.sql.SQLWarning;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Enumeration;
@@ -182,13 +183,17 @@
 
     public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) {
         Collection<ADBDriverProperty> supportedProperties = getOrCreateDriverContext().supportedProperties.values();
-        DriverPropertyInfo[] result = new DriverPropertyInfo[supportedProperties.size()];
-        int i = 0;
+        List<DriverPropertyInfo> result = new ArrayList<>(supportedProperties.size());
         for (ADBDriverProperty property : supportedProperties) {
-            result[i++] = new DriverPropertyInfo(property.getPropertyName(),
-                    property.getDefaultValue() != null ? property.getDefaultValue().toString() : null);
+            if (property.isHidden()) {
+                continue;
+            }
+            Object defaultValue = property.getDefaultValue();
+            DriverPropertyInfo propInfo = new DriverPropertyInfo(property.getPropertyName(),
+                    defaultValue != null ? defaultValue.toString() : null);
+            result.add(propInfo);
         }
-        return result;
+        return result.toArray(new DriverPropertyInfo[0]);
     }
 
     public int getMajorVersion() {
diff --git a/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBDriverProperty.java b/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBDriverProperty.java
index 37cf57e..7312861 100644
--- a/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBDriverProperty.java
+++ b/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBDriverProperty.java
@@ -31,16 +31,19 @@
 
     Object getDefaultValue();
 
+    boolean isHidden();
+
     enum Common implements ADBDriverProperty {
 
-        USER("user", Function.identity(), null),
-        PASSWORD("password", Function.identity(), null),
-        CONNECT_TIMEOUT("connectTimeout", Integer::parseInt, null),
-        SOCKET_TIMEOUT("socketTimeout", Integer::parseInt, null),
-        MAX_WARNINGS("maxWarnings", Integer::parseInt, 10),
-        CATALOG_DATAVERSE_MODE("catalogDataverseMode", Integer::parseInt, 1), // 1 -> CATALOG, 2 -> CATALOG_SCHEMA
-        CATALOG_INCLUDES_SCHEMALESS("catalogIncludesSchemaless", Boolean::parseBoolean, false),
-        SQL_COMPAT_MODE("sqlCompatMode", Boolean::parseBoolean, true); // Whether user statements are executed in 'SQL-compat' mode
+        USER("user", Function.identity(), null, false),
+        PASSWORD("password", Function.identity(), null, false),
+        CONNECT_TIMEOUT("connectTimeout", Integer::parseInt, null, false),
+        SOCKET_TIMEOUT("socketTimeout", Integer::parseInt, null, false),
+        MAX_WARNINGS("maxWarnings", Integer::parseInt, 10, false),
+        CATALOG_DATAVERSE_MODE("catalogDataverseMode", Integer::parseInt, 1, false), // 1 -> CATALOG, 2 -> CATALOG_SCHEMA
+        CATALOG_INCLUDES_SCHEMALESS("catalogIncludesSchemaless", Boolean::parseBoolean, false, false),
+        SQL_COMPAT_MODE("sqlCompatMode", Boolean::parseBoolean, true, false), // Whether user statements are executed in 'SQL-compat' mode
+        ACTIVE_REQUESTS_PATH("activeRequestsPath", Function.identity(), null, true);
 
         private final String propertyName;
 
@@ -48,10 +51,13 @@
 
         private final Object defaultValue;
 
-        Common(String propertyName, Function<String, ?> valueParser, Object defaultValue) {
+        private final boolean isHidden;
+
+        Common(String propertyName, Function<String, ?> valueParser, Object defaultValue, boolean isHidden) {
             this.propertyName = Objects.requireNonNull(propertyName);
             this.valueParser = Objects.requireNonNull(valueParser);
             this.defaultValue = defaultValue;
+            this.isHidden = isHidden;
         }
 
         @Override
@@ -59,15 +65,22 @@
             return propertyName;
         }
 
+        @Override
         public Function<String, ?> getValueParser() {
             return valueParser;
         }
 
+        @Override
         public Object getDefaultValue() {
             return defaultValue;
         }
 
         @Override
+        public boolean isHidden() {
+            return isHidden;
+        }
+
+        @Override
         public String toString() {
             return getPropertyName();
         }
diff --git a/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBProtocol.java b/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBProtocol.java
index 119b5bb..cc31c7f 100644
--- a/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBProtocol.java
+++ b/asterixdb-jdbc/asterix-jdbc-core/src/main/java/org/apache/asterix/jdbc/core/ADBProtocol.java
@@ -132,7 +132,7 @@
         URI queryResultEndpoint =
                 createEndpointUri(host, port, getQueryResultEndpointPath(), driverContext.errorReporter);
         URI activeRequestsEndpoint =
-                createEndpointUri(host, port, getActiveRequestsEndpointPath(), driverContext.errorReporter);
+                createEndpointUri(host, port, getActiveRequestsEndpointPath(params), driverContext.errorReporter);
         PoolingHttpClientConnectionManager httpConnectionManager = new PoolingHttpClientConnectionManager();
         int maxConnections = Math.max(16, Runtime.getRuntime().availableProcessors());
         httpConnectionManager.setDefaultMaxPerRoute(maxConnections);
@@ -605,8 +605,9 @@
         return QUERY_RESULT_ENDPOINT_PATH;
     }
 
-    protected String getActiveRequestsEndpointPath() {
-        return ACTIVE_REQUESTS_ENDPOINT_PATH;
+    protected String getActiveRequestsEndpointPath(Map<ADBDriverProperty, Object> params) {
+        String path = (String) ADBDriverProperty.Common.ACTIVE_REQUESTS_PATH.fetchPropertyValue(params);
+        return path != null ? path : ACTIVE_REQUESTS_ENDPOINT_PATH;
     }
 
     private static void closeQuietly(Exception mainExc, java.io.Closeable... closeableList) {
diff --git a/asterixdb-jdbc/asterix-jdbc-taco/pom.xml b/asterixdb-jdbc/asterix-jdbc-taco/pom.xml
index 240e525..552e444 100644
--- a/asterixdb-jdbc/asterix-jdbc-taco/pom.xml
+++ b/asterixdb-jdbc/asterix-jdbc-taco/pom.xml
@@ -60,6 +60,7 @@
     <taco.plugin.database.default>Default</taco.plugin.database.default>
     <taco.plugin.table.label>Dataset</taco.plugin.table.label>
     <taco.plugin.jdbc.scheme>jdbc:asterixdb://</taco.plugin.jdbc.scheme>
+    <taco.plugin.jdbc.properties.aux> </taco.plugin.jdbc.properties.aux>
     <taco.plugin.auth.none><![CDATA[<option value="auth-none" label="No Authentication"/>]]></taco.plugin.auth.none>
   </properties>
 
diff --git a/asterixdb-jdbc/asterix-jdbc-taco/src/main/taco/plugins/asterixdb_jdbc/connectionProperties.js b/asterixdb-jdbc/asterix-jdbc-taco/src/main/taco/plugins/asterixdb_jdbc/connectionProperties.js
index 92058c7..42265f7 100644
--- a/asterixdb-jdbc/asterix-jdbc-taco/src/main/taco/plugins/asterixdb_jdbc/connectionProperties.js
+++ b/asterixdb-jdbc/asterix-jdbc-taco/src/main/taco/plugins/asterixdb_jdbc/connectionProperties.js
@@ -20,5 +20,6 @@
     var props = {};
     props["user"] = attr[connectionHelper.attributeUsername];
     props["password"] = attr[connectionHelper.attributePassword];
+    ${taco.plugin.jdbc.properties.aux}
     return props;
 })
