//TYPCONV GetTypeConv(); //int GetConvSize(); externchar *JvmPath; // The connect_jvm_path global variable value externchar *ClassPath; // The connect_class_path global variable value
char *GetPluginDir(void); char *GetMessageDir(void); char *GetJavaWrapper(void); // The connect_java_wrapper variable value extern MYSQL_PLUGIN_IMPORT char lc_messages_dir[FN_REFLEN];
/***********************************************************************/ /* Dynamically link the JVM library. */ /* The purpose of this function is to allow using the CONNECT plugin */ /* for other table types when the Java JDK is not installed. */ /***********************************************************************/ bool JAVAConn::GetJVM(PGLOBAL g)
{ int ntry;
options[0].optionString = jpop->GetStr(); #if N == 2
options[1].optionString = "-Xcheck:jni"; #endif #if N == 3
options[1].optionString = "-Xms256M";
options[2].optionString = "-Xmx512M"; #endif #ifdefined(_DEBUG)
vm_args.version = JNI_VERSION_1_2; // minimum Java version
rc = GetDefaultJavaVMInitArgs(&vm_args); #else
vm_args.version = JNI_VERSION_1_6; // minimum Java version #endif// _DEBUG
vm_args.nOptions = N; // number of options
vm_args.options = options;
vm_args.ignoreUnrecognized = false; // invalid options make the JVM init fail
//=============== load and initialize Java VM and JNI interface =============
rc = CreateJavaVM(&jvm, (void**)&env, &vm_args); // YES !! delete[] options; // we then no longer need the initialisation options.
switch (rc) { case JNI_OK:
snprintf(g->Message, sizeof(g->Message), "VM successfully created");
brc = false; break; case JNI_ERR:
snprintf(g->Message, sizeof(g->Message), "Initialising JVM failed: unknown error"); break; case JNI_EDETACHED:
snprintf(g->Message, sizeof(g->Message), "Thread detached from the VM"); break; case JNI_EVERSION:
snprintf(g->Message, sizeof(g->Message), "JNI version error"); break; case JNI_ENOMEM:
snprintf(g->Message, sizeof(g->Message), "Not enough memory"); break; case JNI_EEXIST:
snprintf(g->Message, sizeof(g->Message), "VM already created"); break; case JNI_EINVAL:
snprintf(g->Message, sizeof(g->Message), "Invalid arguments"); break; default:
snprintf(g->Message, sizeof(g->Message), "Unknown return code %d", (int)rc); break;
} // endswitch rc
if (trace(1))
htrc("%s\n", g->Message);
if (brc) returntrue;
//=============== Display JVM version ===============
jint ver = env->GetVersion();
printf("JVM Version %d.%d\n", ((ver >> 16) & 0x0f), (ver & 0x0f));
} // endif rc
// try to find the java wrapper class
jdi = env->FindClass(m_Wrap);
if (jdi == nullptr) {
snprintf(g->Message, sizeof(g->Message), "ERROR: class %s not found!", m_Wrap); returntrue;
} // endif jdi
#if0// Suppressed because it does not make any usable change if (b && jpath && *jpath) { // Try to add that path the the jvm class path
jmethodID alp = env->GetStaticMethodID(jdi, "addLibraryPath", "(Ljava/lang/String;)I");
if (job == nullptr) {
snprintf(g->Message, sizeof(g->Message), "%s class object not constructed!", m_Wrap); returntrue;
} // endif job
// If the object is successfully constructed, // we can then search for the method we want to call, // and invoke it for the object:
errid = env->GetMethodID(jdi, "GetErrmsg", "()Ljava/lang/String;");
if (env->ExceptionCheck()) {
snprintf(g->Message, sizeof(g->Message), "ERROR: method GetErrmsg() not found!");
env->ExceptionDescribe();
env->ExceptionClear(); returntrue;
} // endif Check
/*********************************************************************/ /* Link a Fblock. This make possible to automatically close it */ /* in case of error (throw). */ /*********************************************************************/
PDBUSER dbuserp = (PDBUSER)g->Activityp->Aptr;
if ((rc = jvm->DetachCurrentThread()) != JNI_OK)
printf("DetachCurrentThread: rc=%d\n", (int)rc);
if (fp)
fp->Count = 0;
m_Opened = false;
} // end of Close
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.16Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.