提交 456f2a82 编写于 作者: Z zyyang

change

上级 bee49162
......@@ -39,7 +39,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
@SuppressWarnings("unused")
public class TSDBResultSet implements ResultSet {
private TSDBJNIConnector jniConnector = null;
......@@ -104,6 +103,7 @@ public class TSDBResultSet implements ResultSet {
}
public TSDBResultSet() {
}
public TSDBResultSet(TSDBJNIConnector connector, long resultSetPointer) throws SQLException {
......
......@@ -68,12 +68,6 @@ public class TSDBStatement implements Statement {
// TODO make sure it is not a update query
pSql = this.connector.executeQuery(sql);
try {
TimeUnit.SECONDS.sleep(10);
} catch (InterruptedException e) {
e.printStackTrace();
}
long resultSetPointer = this.connector.getResultSet();
if (resultSetPointer == TSDBConstants.JNI_CONNECTION_NULL) {
this.connector.freeResultSet(pSql);
......
package com.taosdata.jdbc.cases;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import java.sql.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
public class MultiThreadsWithSameStatmentTest {
......@@ -28,7 +26,7 @@ public class MultiThreadsWithSameStatmentTest {
}
}
public void release(){
public void release() {
try {
stmt.close();
conn.close();
......@@ -63,6 +61,7 @@ public class MultiThreadsWithSameStatmentTest {
});
Thread t2 = new Thread(() -> {
while (true) {
try {
Service service = new Service();
service.stmt.executeUpdate("insert into jdbctest.weather values(now,1)");
......@@ -70,6 +69,8 @@ public class MultiThreadsWithSameStatmentTest {
} catch (SQLException e) {
e.printStackTrace();
}
}
});
t1.start();
sleep(1000);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册