public static edu.isi.sdbc.Connection getConnectionFromDatabase(LogicObject database) {
    { Stella_Object connection = Logic.accessBinaryValue(database, RDBMS.SGT_RDBMS_DB_CONNECTION);

      if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(connection), RDBMS.SGT_RDBMS_CONNECTION_WRAPPER)) {
        { ConnectionWrapper connection000 = ((ConnectionWrapper)(connection));

          return (connection000.wrapperValue);
        }
      }
      else {
        return (RDBMS.connectToDatabase(database));
      }
    }
  }