{"record":{"id":"8e175a43eb1fb01f","repo":"alibaba/DataX","slug":"101","errorCode":"-101","errorMessage":"ADS JDBC connection user name was not set.","messagePattern":"ADS JDBC connection user name was not set\\.","errorType":"error_code","errorClass":"AdsException","httpStatus":null,"severity":"error","filePath":"adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java","lineNumber":97,"sourceCode":"    /**\n     * Obtain the table meta information.\n     * \n     * @param table The table\n     * @return The table meta information\n     * @throws com.alibaba.datax.plugin.writer.adswriter.AdsException\n     */\n    public TableInfo getTableInfo(String table) throws AdsException {\n\n        if (table == null) {\n            throw new AdsException(AdsException.ADS_TABLEMETA_TABLE_NULL, \"Table is null.\", null);\n        }\n\n        if (adsURL == null) {\n            throw new AdsException(AdsException.ADS_CONN_URL_NOT_SET, \"ADS JDBC connection URL was not set.\", null);\n        }\n\n        if (userName == null) {\n            throw new AdsException(AdsException.ADS_CONN_USERNAME_NOT_SET,\n                    \"ADS JDBC connection user name was not set.\", null);\n        }\n\n        if (password == null) {\n            throw new AdsException(AdsException.ADS_CONN_PASSWORD_NOT_SET, \"ADS JDBC connection password was not set.\",\n                    null);\n        }\n\n        if (schema == null) {\n            throw new AdsException(AdsException.ADS_CONN_SCHEMA_NOT_SET, \"ADS JDBC connection schema was not set.\",\n                    null);\n        }\n\n        Connection connection = null;\n        Statement statement = null;\n        ResultSet rs = null;\n        try {\n            Class.forName(\"com.mysql.jdbc.Driver\");","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/adswriter/src/main/java/com/alibaba/datax/plugin/writer/adswriter/load/AdsHelper.java#L79-L115","documentation":"Third guard in getTableInfo: a null userName on AdsHelper throws AdsException code -101 (ADS_CONN_USERNAME_NOT_SET) before any JDBC work. The ADS account used for metadata lookup was not provided.","triggerScenarios":"getTableInfo called when the writer config lacks the 'username' key, so AdsHelper.userName stays null.","commonSituations":"Missing username in the adswriter parameter block, or key spelled 'user' (the RDS/MySQL convention) instead of 'username'.","solutions":["Add 'username' with the ADS account name to the adswriter parameter block.","Confirm spelling is username, not user, for this plugin.","Verify no leading/trailing whitespace that could make the value effectively blank."],"exampleFix":"// before\n{\"parameter\":{\"url\":\"...\",\"table\":\"t\"}}\n// after\n{\"parameter\":{\"url\":\"...\",\"table\":\"t\",\"username\":\"ads_user\"}}","handlingStrategy":"validation","validationCode":"if (config.getString(\"username\") == null) {\n    throw new IllegalStateException(\"adswriter 'username' key is required\");\n}","typeGuard":"boolean isUsernameSet(String u) { return u != null && !u.trim().isEmpty(); }","tryCatchPattern":"try {\n    return helper.getTableInfo(table);\n} catch (AdsException e) {\n    if (e.getCode() == AdsException.ADS_CONN_USERNAME_NOT_SET) {\n        throw new IllegalStateException(\"job config: ADS 'username' missing\", e);\n    }\n    throw e;\n}","preventionTips":["Use 'username' (not 'user') in adswriter configs; check the plugin's Key class for your version.","Run a config lint step that fails on missing credentials keys before submission.","Avoid hand-editing generated job JSON - regenerate from a template."],"tags":["adswriter","config","credentials","validation"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}