[JIRANONE] modify JDBC client, if there is no action after query, before return 0 rows result, now throw exception
This commit is contained in:
parent
b338b3b194
commit
638865fd5b
|
@ -396,8 +396,18 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
|
||||||
|
|
||||||
TAOS_ROW row = taos_fetch_row(result);
|
TAOS_ROW row = taos_fetch_row(result);
|
||||||
if (row == NULL) {
|
if (row == NULL) {
|
||||||
|
int tserrno = taos_errno(tscon);
|
||||||
|
if (tserrno == 0) {
|
||||||
jniTrace("jobj:%p, taos:%p, resultset:%p, fields size is %d, fetch row to the end", jobj, tscon, res, num_fields);
|
jniTrace("jobj:%p, taos:%p, resultset:%p, fields size is %d, fetch row to the end", jobj, tscon, res, num_fields);
|
||||||
return JNI_FETCH_END;
|
return JNI_FETCH_END;
|
||||||
|
} else {
|
||||||
|
jclass cls;
|
||||||
|
cls = (*env)->FindClass(env,"com/taosdata/jdbc/TSDBError");
|
||||||
|
if(cls == NULL){
|
||||||
|
return JNI_TDENGINE_ERROR;
|
||||||
|
}
|
||||||
|
(*env)->ThrowNew(env,cls,"Interruppted query");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < num_fields; i++) {
|
for (int i = 0; i < num_fields; i++) {
|
||||||
|
|
Loading…
Reference in New Issue