提交 7c679fed 编写于 作者: Z zyyang

[TD-6537]<feature>: jdbc-jni support error code and message for setConfigImp

上级 23332951
...@@ -44,9 +44,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setOptions ...@@ -44,9 +44,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setOptions
/* /*
* Class: com_taosdata_jdbc_TSDBJNIConnector * Class: com_taosdata_jdbc_TSDBJNIConnector
* Method: setConfigImp * Method: setConfigImp
* Signature: (ILjava/lang/String;)I * Signature: (Ljava/lang/String;)Lcom/taosdata/jdbc/TSDBException;
*/ */
JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setConfigImp JNIEXPORT jobject JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setConfigImp
(JNIEnv *, jclass, jstring); (JNIEnv *, jclass, jstring);
/* /*
......
此差异已折叠。
...@@ -440,7 +440,7 @@ int taos_options(TSDB_OPTION option, const void *arg, ...) { ...@@ -440,7 +440,7 @@ int taos_options(TSDB_OPTION option, const void *arg, ...) {
#include "cJSON.h" #include "cJSON.h"
static setConfRet taos_set_config_imp(const char *config){ static setConfRet taos_set_config_imp(const char *config){
setConfRet ret = {0}; setConfRet ret;
static bool setConfFlag = false; static bool setConfFlag = false;
if (setConfFlag) { if (setConfFlag) {
ret.retCode = -5; ret.retCode = -5;
......
package com.taosdata.jdbc;
public class TSDBException {
private int code;
private String message;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
\ No newline at end of file
...@@ -77,7 +77,7 @@ public class TSDBJNIConnector { ...@@ -77,7 +77,7 @@ public class TSDBJNIConnector {
private static native String getTsCharset(); private static native String getTsCharset();
private static native int setConfigImp(String config); private static native TSDBException setConfigImp(String config);
public boolean connect(String host, int port, String dbName, String user, String password) throws SQLException { public boolean connect(String host, int port, String dbName, String user, String password) throws SQLException {
if (this.taos != TSDBConstants.JNI_NULL_POINTER) { if (this.taos != TSDBConstants.JNI_NULL_POINTER) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册