{"record":{"id":"d873f309a55ac264","repo":"prestodb/presto","slug":"connection-property-s-is-both-in-the-url-and-an","errorCode":null,"errorMessage":"Connection property '%s' is both in the URL and an argument","messagePattern":"Connection property '(.+?)' is both in the URL and an argument","errorType":"validation","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java","lineNumber":434,"sourceCode":"\n        if (parts.size() > 1) {\n            if (parts.get(1).isEmpty()) {\n                throw new SQLException(\"Schema name is empty: \" + uri);\n            }\n            schema = parts.get(1);\n        }\n    }\n\n    private static Properties mergeConnectionProperties(URI uri, Properties driverProperties)\n            throws SQLException\n    {\n        Map<String, String> defaults = ConnectionProperties.getDefaults();\n        Map<String, String> urlProperties = parseParameters(uri.getQuery());\n        Map<String, String> suppliedProperties = Maps.fromProperties(driverProperties);\n\n        for (String key : urlProperties.keySet()) {\n            if (suppliedProperties.containsKey(key)) {\n                throw new SQLException(format(\"Connection property '%s' is both in the URL and an argument\", key));\n            }\n        }\n\n        Properties result = new Properties();\n        setProperties(result, defaults);\n        setProperties(result, urlProperties);\n        setProperties(result, suppliedProperties);\n        return result;\n    }\n\n    private static void setProperties(Properties properties, Map<String, String> values)\n    {\n        for (Entry<String, String> entry : values.entrySet()) {\n            properties.setProperty(entry.getKey(), entry.getValue());\n        }\n    }\n\n    private static void validateConnectionProperties(Properties connectionProperties)","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java#L416-L452","documentation":"mergeConnectionProperties rejects a JDBC URL that specifies the same connection property both as a URL query parameter and as an entry in the driver Properties argument. This is a conflict guard: Presto cannot decide which value wins, so the URI is rejected before a connection is attempted.","triggerScenarios":"Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDriverUri.java:434 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the duplicate property from either the JDBC URL or the Properties object so each key appears in only one place","Compare the URL parameters (parseParameters(uri.getQuery())) with the supplied Properties to find the overlapping keys","Adopt one source of truth for configuration, e.g. pass all properties via the URL, and document the precedence for other users"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}