提交 ad767f6d 编写于 作者: wmmhello's avatar wmmhello

Merge branch 'feature/TD-5992' of github.com:taosdata/TDengine into feature/TD-5992

......@@ -18,9 +18,9 @@ IF (TD_LINUX)
# generate dynamic library (*.so)
ADD_LIBRARY(taos SHARED ${SRC})
TARGET_LINK_LIBRARIES(taos common query trpc tutil pthread m rt)
TARGET_LINK_LIBRARIES(taos common query trpc cJson tutil pthread m rt)
IF (TD_LINUX_64)
TARGET_LINK_LIBRARIES(taos lua)
TARGET_LINK_LIBRARIES(taos lua cJson)
ENDIF ()
SET_TARGET_PROPERTIES(taos PROPERTIES CLEAN_DIRECT_OUTPUT 1)
......@@ -39,13 +39,13 @@ ELSEIF (TD_DARWIN)
# set the static lib name
ADD_LIBRARY(taos_static STATIC ${SRC})
TARGET_LINK_LIBRARIES(taos_static common query trpc tutil pthread m lua cJson)
TARGET_LINK_LIBRARIES(taos_static common query trpc cJson tutil pthread m lua cJson)
SET_TARGET_PROPERTIES(taos_static PROPERTIES OUTPUT_NAME "taos_static")
SET_TARGET_PROPERTIES(taos_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
# generate dynamic library (*.dylib)
ADD_LIBRARY(taos SHARED ${SRC})
TARGET_LINK_LIBRARIES(taos common query trpc tutil pthread m lua)
TARGET_LINK_LIBRARIES(taos common query cJson trpc tutil pthread m lua)
SET_TARGET_PROPERTIES(taos PROPERTIES CLEAN_DIRECT_OUTPUT 1)
#set version of .dylib
......@@ -64,14 +64,14 @@ ELSEIF (TD_WINDOWS)
CONFIGURE_FILE("${TD_COMMUNITY_DIR}/src/client/src/taos.rc.in" "${TD_COMMUNITY_DIR}/src/client/src/taos.rc")
ADD_LIBRARY(taos_static STATIC ${SRC})
TARGET_LINK_LIBRARIES(taos_static trpc tutil cJson query)
TARGET_LINK_LIBRARIES(taos_static trpc cJson tutil cJson query)
# generate dynamic library (*.dll)
ADD_LIBRARY(taos SHARED ${SRC} ${TD_COMMUNITY_DIR}/src/client/src/taos.rc)
IF (NOT TD_GODLL)
SET_TARGET_PROPERTIES(taos PROPERTIES LINK_FLAGS /DEF:${TD_COMMUNITY_DIR}/src/client/src/taos.def)
ENDIF ()
TARGET_LINK_LIBRARIES(taos trpc tutil query lua)
TARGET_LINK_LIBRARIES(taos trpc cJson tutil query lua)
ELSEIF (TD_DARWIN)
SET(CMAKE_MACOSX_RPATH 1)
......@@ -79,12 +79,12 @@ ELSEIF (TD_DARWIN)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/cJson/inc)
ADD_LIBRARY(taos_static STATIC ${SRC})
TARGET_LINK_LIBRARIES(taos_static query trpc tutil pthread cJson m lua)
TARGET_LINK_LIBRARIES(taos_static query trpc cJson tutil pthread cJson m lua)
SET_TARGET_PROPERTIES(taos_static PROPERTIES OUTPUT_NAME "taos_static")
# generate dynamic library (*.dylib)
ADD_LIBRARY(taos SHARED ${SRC})
TARGET_LINK_LIBRARIES(taos query trpc tutil pthread m lua)
TARGET_LINK_LIBRARIES(taos query trpc cJson tutil pthread m lua)
SET_TARGET_PROPERTIES(taos PROPERTIES CLEAN_DIRECT_OUTPUT 1)
......
......@@ -63,6 +63,8 @@ public class TSDBJNIConnector {
public static native String getTsCharset();
public static native int setConfig(String config);
public boolean connect(String host, int port, String dbName, String user, String password) throws SQLException {
if (this.taos != TSDBConstants.JNI_NULL_POINTER) {
closeConnection();
......@@ -358,6 +360,5 @@ public class TSDBJNIConnector {
private native int insertLinesImp(String[] lines, long conn);
private native int setConfig(String config);
}
......@@ -19,13 +19,17 @@ public class SetConfigurationInJNITest {
@Test
public void testDebugFlag() {
try {
// init
TSDBJNIConnector.initImp(null);
TSDBJNIConnector.setOptions(0, null);
TSDBJNIConnector.setOptions(1, null);
TSDBJNIConnector.setOptions(2, null);
String tsCharset = TSDBJNIConnector.getTsCharset();
System.out.println(tsCharset);
assertEquals("", tsCharset);
TSDBJNIConnector.setConfig(debugFlagJSON);
// connect
TSDBJNIConnector jniConnector = new TSDBJNIConnector();
boolean connected = jniConnector.connect(host, 0, null, "root", "taosdata");
assertTrue(connected);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册