{"record":{"id":"3b4a3628974a0218","repo":"t8y2/dbx","slug":"object-source-is-not-supported-by-this-jdbc-driver","errorCode":null,"errorMessage":"Object source is not supported by this JDBC driver","messagePattern":"Object source is not supported by this JDBC driver","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java","lineNumber":4035,"sourceCode":"                        }\n                        ObjectNode item = MAPPER.createObjectNode();\n                        item.put(\"name\", name);\n                        item.put(\"object_type\", objectType);\n                        putNullable(item, \"schema\", emptyToNull(schema) != null ? schema : candidateDb);\n                        putNullable(item, \"source\", rs.getString(1));\n                        return item;\n                    }\n                }\n            }\n\n            throw new SQLException(\"Object source not found\");\n        }\n\n        if (\"TABLE\".equals(normalizeObjectType(objectType))) {\n            return genericTableObjectSource(connection, database, schema, name);\n        }\n\n        throw new SQLException(\"Object source is not supported by this JDBC driver\");\n    }\n\n    /**\n     * Table source for generic external JDBC drivers (JDBCX wrappers, custom\n     * protocol drivers) that expose no vendor DDL statement: assemble CREATE\n     * TABLE from {@code DatabaseMetaData} via the same readers the browse RPCs\n     * use, so driver quirks (catalog fallback, PK marking, tolerance of\n     * unimplemented metadata methods) apply identically.\n     */\n    private static JsonNode genericTableObjectSource(JsonNode connection, String database, String schema, String table)\n        throws SQLException {\n        JsonNode columns = getColumns(connection, database, schema, table);\n        if (!columns.isArray() || columns.isEmpty()) {\n            throw new SQLException(\"Object source not found\");\n        }\n        JsonNode indexes = listIndexes(connection, database, schema, table);\n\n        JsonNode foreignKeys;","sourceCodeStart":4017,"sourceCodeEnd":4053,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java#L4017-L4053","documentation":"Catch-all at the end of the object-source dispatcher: when the normalized object type is neither handled by the Hive/Inceptor branches nor TABLE, the JDBC plugin has no vendor DDL mechanism and refuses the request. It signals a capability limitation of the connected driver rather than a data problem.","triggerScenarios":"Requesting source for object types other than TABLE on generic JDBC drivers (e.g. VIEW, SEQUENCE, INDEX, SYNONYM) where the plugin has no source-building branch.","commonSituations":"Client assumes the driver can emit DDL for every object kind listed in the catalog browse; passing \"View\" with different casing that misses normalization; driver without metadata support so only the TABLE path exists.","solutions":["Request source only for TABLE objects on generic JDBC drivers, or use the Hive-specific branches for views where supported","Recreate DDL manually from column/index metadata returned by the browse RPCs","Check whether a vendor-specific plugin exists for the target database","Upgrade the plugin to a version adding support for the object type"],"exampleFix":"// before\nsource(connection, \"MY_SEQ\", \"SEQUENCE\");\n// after\nsource(connection, \"orders\", \"TABLE\"); // only TABLE is generically supported","handlingStrategy":"fallback","validationCode":"if (!\"TABLE\".equalsIgnoreCase(objectType)) {\n    throw new UnsupportedOperationException(\n        \"Generic JDBC driver supports source only for TABLE, got: \" + objectType);\n}","typeGuard":"boolean supportsSourceFor(String objectType) { return \"TABLE\".equalsIgnoreCase(objectType); }","tryCatchPattern":"try {\n    return rpc.objectSource(connCfg, db, schema, name, objectType);\n} catch (SQLException e) {\n    if (e.getMessage().contains(\"not supported by this JDBC driver\")) {\n        // fallback: reconstruct DDL from column/index browse RPCs or vendor tooling\n        return rebuildDdlFromMetadata(connCfg, db, schema, name);\n    }\n    throw e;\n}","preventionTips":["Restrict source requests to TABLE objects on generic drivers","Use vendor-specific plugins for views/sequences/routines","Derive DDL from metadata browse RPCs when source is unavailable","Check driver capability documentation before enabling source UI actions"],"tags":["jdbc","unsupported-operation","capability"],"backgroundTag":"unsupported-object-type","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}