morningman commented on code in PR #14527:
URL: https://github.com/apache/doris/pull/14527#discussion_r1035451568


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/JdbcExternalCatalog.java:
##########
@@ -0,0 +1,173 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.datasource;
+
+import org.apache.doris.catalog.Column;
+import org.apache.doris.catalog.Env;
+import org.apache.doris.catalog.external.ExternalDatabase;
+import org.apache.doris.catalog.external.JdbcExternalDatabase;
+import org.apache.doris.external.jdbc.JdbcClient;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import lombok.Getter;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+@Getter
+public class JdbcExternalCatalog extends ExternalCatalog {
+    private static final Logger LOG = 
LogManager.getLogger(JdbcExternalCatalog.class);
+
+    public static final String PROP_USER = "jdbc.user";
+    public static final String PROP_PASSWORD = "jdbc.password";
+    public static final String PROP_JDBC_URL = "jdbc.jdbc_url";
+    public static final String PROP_DRIVER_URL = "jdbc.driver_url";
+    public static final String PROP_DRIVER_CLASS = "jdbc.driver_class";
+
+    private JdbcClient jdbcClient;
+    private String databaseTypeName;
+    private String jdbcUser;
+    private String jdbcPasswd;
+    private String jdbcUrl;
+    private String driverUrl;
+    private String driverClass;
+    private String checkSum;
+
+    public JdbcExternalCatalog(long catalogId, String name, Map<String, 
String> props) {
+        this.id = catalogId;
+        this.name = name;
+        this.type = "jdbc";
+        setProperties(props);
+        this.catalogProperty = new CatalogProperty();
+        this.catalogProperty.setProperties(props);
+    }
+
+    @Override
+    public void onClose() {
+        jdbcClient.closeClient();

Review Comment:
   jdbcClient may not be set, should check `if (jdbcClient != null)`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to