diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java index b400aeb95e263664fcce4791b8a661523b086c86..f980dd041b3eff0aa09868490f0678ee1f8b1ab7 100755 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java @@ -49,7 +49,10 @@ public class TSDBJNIConnector { for (String key : props.stringPropertyNames()) { configJSON.put(key, props.getProperty(key)); } - setConfig(configJSON.toJSONString()); + int ret = setConfigImp(configJSON.toJSONString()); + if (ret == -1) { + throw TSDBError.createSQLWarning("failed to set config, invalid json format: " + configJSON.toJSONString()); + } String configDir = props.getProperty(TSDBDriver.PROPERTY_KEY_CONFIG_DIR); initImp(configDir); @@ -79,10 +82,6 @@ public class TSDBJNIConnector { private static native String getTsCharset(); - public static void setConfig(String config) { - setConfigImp(config); - } - private static native int setConfigImp(String config); public boolean connect(String host, int port, String dbName, String user, String password) throws SQLException {