MCPcopy Create free account
hub / github.com/MariaDB/server / GetDrivers

Method GetDrivers

storage/connect/jdbconn.cpp:1347–1388  ·  view source on GitHub ↗

/ Get the list of Drivers and set it in qrp. */ /

Source from the content-addressed store, hash-verified

1345 /* Get the list of Drivers and set it in qrp. */
1346 /***********************************************************************/
1347 bool JDBConn::GetDrivers(PQRYRES qrp)
1348 {
1349 PSZ sval;
1350 int i, n, size;
1351 PCOLRES crp;
1352 jstring js;
1353 jmethodID gdid = nullptr;
1354
1355 if (gmID(m_G, gdid, "GetDrivers", "([Ljava/lang/String;I)I"))
1356 return true;
1357
1358 // Build the java string array
1359 jobjectArray s = env->NewObjectArray(4 * qrp->Maxres,
1360 env->FindClass("java/lang/String"), NULL);
1361
1362 size = env->CallIntMethod(job, gdid, s, qrp->Maxres);
1363
1364 for (i = 0, n = 0; i < size; i++) {
1365 crp = qrp->Colresp;
1366 js = (jstring)env->GetObjectArrayElement(s, n++);
1367 sval = GetUTFString(js);
1368 crp->Kdata->SetValue(sval, i);
1369 crp = crp->Next;
1370 js = (jstring)env->GetObjectArrayElement(s, n++);
1371 sval = GetUTFString(js);
1372 crp->Kdata->SetValue(sval, i);
1373 crp = crp->Next;
1374 js = (jstring)env->GetObjectArrayElement(s, n++);
1375 sval = GetUTFString(js);
1376 crp->Kdata->SetValue(sval, i);
1377 crp = crp->Next;
1378 js = (jstring)env->GetObjectArrayElement(s, n++);
1379 sval = GetUTFString(js);
1380 crp->Kdata->SetValue(sval, i);
1381 } // endfor i
1382
1383 // Not used anymore
1384 env->DeleteLocalRef(s);
1385
1386 qrp->Nblin = size;
1387 return false;
1388 } // end of GetDrivers
1389
1390 /**************************************************************************/
1391 /* GetMetaData: constructs the result blocks containing the */

Callers 1

JDBCDriversFunction · 0.45

Calls 1

SetValueMethod · 0.45

Tested by

no test coverage detected