// If there are any Java connection objects present in 
// 'lmUtilityConnList' then the following actions are taken:
// - Calls the 'close()' method on the connection
// - Deletes the object reference
// - Removes the connection entry from 'lmUtilityConnList'
// 
// The method expects the following as input:
// - Pointer to the JNIEnv interface
// - JNI method ID of java.sql.Connection.close() method
//
void lmUtilityInitConnList( JNIEnv *jni, jmethodID connCloseId )
{
  while( lmUtilityConnList.entries() )
  {
    jobject conn = lmUtilityConnList[0];

    if( conn )
    {
      jni->CallVoidMethod( conn,
                           connCloseId );
      jni->ExceptionClear();
    }

    jni->DeleteGlobalRef( conn );
    lmUtilityConnList.removeAt(0);
  }

  lmUtilityConnList.clear();
}