no need for an updatedJdbcDriver because changes will not impact the mbean
977975
private static BundleContext getBundleContext(final Bundle bundle) {
        if (System.getSecurityManager() == null)
            return bundle.getBundleContext();
        else
            return AccessController.doPrivileged(new PrivilegedAction<BundleContext>() {
                @Override
                public BundleContext run() {
                    return bundle.getBundleContext();
                }
            });
    }
1337505
private void initMBean()  {
        try {
            registerMBean(this,getObjectName());
        } catch (InstanceAlreadyExistsException exp) {
            // This is no problem, since this MBeanServerHandlerMBean holds only global information
            // with no special state (so all instances of this MBean behave similar)
            // This exception can happen, when multiple servlets get registered within the same JVM
        } catch (MalformedObjectNameException e) {
            // Cannot happen, otherwise this is a bug. We should be always provide our own name in correct
            // form.
            throw new IllegalStateException("Internal Error: Own ObjectName " + getObjectName() + " is malformed",e);
        } catch (NotCompliantMBeanException e) {
            // Same here
            throw new IllegalStateException("Internal Error: " + this.getClass().getName() + " is not a compliant MBean",e);
        }
    }
447623
public static void registerMBean(String packageName, String type, String name, Object mbean) {
		try {
			String pkg = defaultString(packageName, mbean.getClass().getPackage().getName());
			MBeanServer server = ManagementFactory.getPlatformMBeanServer();
			ObjectName on = new ObjectName(pkg + ":type=" + type + ",name=" + name);
			if (server.isRegistered(on)) {
				Say.debug("MBean with type {type} and name {name} for {package} has already been defined, ignoring", type, name, pkg);
			}
			else {
				server.registerMBean(mbean, on);
			}
		}
		catch (Exception ex) {
			Say.warn("MBean could not be registered", ex);
		}
	}
56570
public boolean validateJdbc() {

        boolean result = false;
        String libFolder = getLibFolder();
        Iterator<String> it = getDatabaseLibs(getDatabase()).iterator();
        while (it.hasNext()) {
            String libName = it.next();
            File libFile = new File(libFolder, libName);
            if (libFile.exists()) {
                result = true;
            }
        }
        return result;
    }
243919
public static boolean clean(final java.nio.ByteBuffer buffer) {
        if (buffer == null || !buffer.isDirect()) {
            return false;
        }
        if (cleanJava9(buffer)) {
        	return true;
        }
        return cleanOldsJDK(buffer);
    }
986593
@Override
  public final void changeDatabase(final String pDbName) throws Exception {
    String dbNm = this.databasePrefix + pDbName + ".sqlite";
    synchronized (this.factoryAppBeans) {
      if (!this.factoryAppBeans.getDatabaseName().equals(dbNm)) {
        this.factoryAppBeans.setDatabaseName(dbNm);
        this.factoryAppBeans.handleDatabaseChanged();
      }
    }
  }
685269
public static boolean isCompatibleJREVersion(String version) {
		if (version != null && !version.isEmpty()) {
			final Version current = Version.parseVersion(version);
			if (current != null) {
				final Version minJdk = Version.parseVersion(SARLVersion.MINIMAL_JDK_VERSION);
				assert minJdk != null;
				if (current.compareTo(minJdk) >= 0) {
					final Version maxJdk = Version.parseVersion(SARLVersion.MAXIMAL_JDK_VERSION);
					assert maxJdk != null;
					return current.compareTo(maxJdk) <= 0;
				}
			}
		}
		return false;
	}
410158
public void jdbc(String driver, String url, String user, String password) {
        connectionWrapper.setConnectionSpec(new ConnectionJdbcSpec(driver, url, user, password));
    }
896692
@Override
	public synchronized void rebuildDirtyBundles() {

		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Rebuild dirty bundles");
		}

		StopWatch stopWatch = new StopWatch();
		ThreadLocalJawrContext.setStopWatch(stopWatch);

		// Initialize the Thread local for the Jawr context
		ThreadLocalJawrContext.setJawrConfigMgrObjectName(JmxUtils.getMBeanObjectName(servletContext, resourceType,
				jawrConfig.getProperty(JawrConstant.JAWR_JMX_MBEAN_PREFIX)));

		try {
			if (bundlesHandler != null) {
				bundlesHandler.rebuildModifiedBundles();
			}

			if (LOGGER.isDebugEnabled()) {
				LOGGER.debug("Jawr configuration successfully reloaded. ");
			}
			if (PERF_PROCESSING_LOGGER.isDebugEnabled()) {
				PERF_PROCESSING_LOGGER.debug(stopWatch.prettyPrint());
			}

		} catch (InterruptBundlingProcessException e) {
			if (LOGGER.isInfoEnabled()) {
				LOGGER.info("Bundling processed stopped");
			}
		} catch (Exception e) {
			throw new BundlingProcessException("Error while rebuilding dirty bundles : " + e.getMessage(), e);

		} finally {

			// Reset the Thread local for the Jawr context
			ThreadLocalJawrContext.reset();
		}
	}
964809
protected CompletableFuture<ClientResponse> runNonDDLAdHoc(CatalogContext context,
                                                               List<String> sqlStatements,
                                                               boolean inferPartitioning,
                                                               Object userPartitionKey,
                                                               ExplainMode explainMode,
                                                               boolean isLargeQuery,
                                                               boolean isSwapTables,
                                                               Object[] userParamSet)
    {
        // record the catalog version the query is planned against to
        // catch races vs. updateApplicationCatalog.
        if (context == null) {
            context = VoltDB.instance().getCatalogContext();
        }

        List<String> errorMsgs = new ArrayList<>();
        List<AdHocPlannedStatement> stmts = new ArrayList<>();
        int partitionParamIndex = -1;
        VoltType partitionParamType = null;
        Object partitionParamValue = null;
        assert(sqlStatements != null);

        boolean inferSP = (sqlStatements.size() == 1) && inferPartitioning;

        if (userParamSet != null && userParamSet.length > 0) {
            if (sqlStatements.size() != 1) {
                return makeQuickResponse(ClientResponse.GRACEFUL_FAILURE,
                                         AdHocErrorResponseMessage);
            }
        }

        for (final String sqlStatement : sqlStatements) {
            try {
                AdHocPlannedStatement result = compileAdHocSQL(context.m_ptool,
                                                               sqlStatement,
                                                               inferSP,
                                                               userPartitionKey,
                                                               explainMode,
                                                               isLargeQuery,
                                                               isSwapTables,
                                                               userParamSet);
                // The planning tool may have optimized for the single partition case
                // and generated a partition parameter.
                if (inferSP) {
                    partitionParamIndex = result.getPartitioningParameterIndex();
                    partitionParamType = result.getPartitioningParameterType();
                    partitionParamValue = result.getPartitioningParameterValue();
                }
                stmts.add(result);
            }
            catch (AdHocPlanningException e) {
                errorMsgs.add(e.getMessage());
            }
        }

        if (!errorMsgs.isEmpty()) {
            String errorSummary = StringUtils.join(errorMsgs, "\n");
            return makeQuickResponse(ClientResponse.GRACEFUL_FAILURE, errorSummary);
        }

        AdHocPlannedStmtBatch plannedStmtBatch =
                new AdHocPlannedStmtBatch(userParamSet,
                                          stmts,
                                          partitionParamIndex,
                                          partitionParamType,
                                          partitionParamValue,
                                          userPartitionKey == null ? null : new Object[] { userPartitionKey });

        if (adhocLog.isDebugEnabled()) {
            logBatch(context, plannedStmtBatch, userParamSet);
        }

        final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.CI);
        if (traceLog != null) {
            traceLog.add(() -> VoltTrace.endAsync("planadhoc", getClientHandle()));
        }

        if (explainMode == ExplainMode.EXPLAIN_ADHOC) {
            return processExplainPlannedStmtBatch(plannedStmtBatch);
        }
        else if (explainMode == ExplainMode.EXPLAIN_DEFAULT_PROC) {
            return processExplainDefaultProc(plannedStmtBatch);
        }
        else if (explainMode == ExplainMode.EXPLAIN_JSON) {
            return processExplainPlannedStmtBatchInJSON(plannedStmtBatch);
        }
        else {
            try {
                return createAdHocTransaction(plannedStmtBatch, isSwapTables);
            }
            catch (VoltTypeException vte) {
                String msg = "Unable to execute adhoc sql statement(s): " + vte.getMessage();
                return makeQuickResponse(ClientResponse.GRACEFUL_FAILURE, msg);
            }
        }
    }
218514
private void updateDOTable() throws InstallationFailedException {
        if (_db.equals(InstallOptions.INCLUDED)) {
            return; // no need to update embedded
        }
        try {
            Connection conn = getConnection();
            DatabaseMetaData dmd = conn.getMetaData();
            ResultSet rs = dmd.getTables(null, null, "do%", null);
            while (rs.next()) {
                if (rs.getString("TABLE_NAME").equals("do")) {
                    Statement stmt = conn.createStatement();
                    stmt.execute("ALTER TABLE do RENAME TO dobj");
                    System.out.println("Renamed table 'do' to 'dobj'.");
                    stmt.close();
                }
            }
            rs.close();
        } catch (Exception e) {
            throw new InstallationFailedException(e.getMessage(), e);
        }
    }
929639
public boolean execUpdate(D6Model modelObj, D6Inex includeExcludeColumnNames) {

    boolean retVal = false;

    if (modelObj == null) {
      return retVal;
    }

    final D6CrudUpdateHelper d6CrudUpdateHelper = new D6CrudUpdateHelper(modelObj.getClass());

    final String updateSQL = d6CrudUpdateHelper.createUpdatePreparedSQLStatement(includeExcludeColumnNames);

    log("#execUpdate updateSQL=" + updateSQL);

    final Connection conn = createConnection();

    try {

      PreparedStatement preparedStmt = null;

      // There is a possibility that the error occurs in one single update
      // statement.
      // Therefore, turn the auto commit off.
      conn.setAutoCommit(false);

      preparedStmt = conn.prepareStatement(updateSQL);

      d6CrudUpdateHelper.map(modelObj, preparedStmt, includeExcludeColumnNames);

      // execute SQL
      preparedStmt.executeUpdate();

      // finally commit
      conn.commit();

      retVal = true;

    } catch (SQLException e) {

      loge("#execUpdate", e);
      retVal = false;

    } catch (D6Exception e) {

      // catch from helper
      loge("#execUpdate", e);
      retVal = false;

    } finally {
      try {
        conn.close();
      } catch (SQLException e) {
        retVal = false;
        loge("#execUpdate", e);
      }
    }
    return retVal;

  }
93191
void setUnchanged() {

        m_changedEntityIds.clear();
        m_deletedEntities.clear();
        disableSave(Messages.get().key(Messages.GUI_TOOLBAR_NOTHING_CHANGED_0));
    }
49788
@Override
    public boolean update(Engine engine) throws UpdateException {
        this.settings = engine.getSettings();
        String url = null;
        try {
            final boolean autoupdate = settings.getBoolean(Settings.KEYS.AUTO_UPDATE, true);
            final boolean enabled = settings.getBoolean(Settings.KEYS.ANALYZER_RETIREJS_ENABLED, true);
            final File repoFile = new File(settings.getDataDirectory(), "jsrepository.json");
            final boolean proceed = enabled && autoupdate && shouldUpdagte(repoFile);
            if (proceed) {
                LOGGER.debug("Begin RetireJS Update");
                url = settings.getString(Settings.KEYS.ANALYZER_RETIREJS_REPO_JS_URL, DEFAULT_JS_URL);
                initializeRetireJsRepo(settings, new URL(url));
            }
        } catch (InvalidSettingException ex) {
            throw new UpdateException("Unable to determine if autoupdate is enabled", ex);
        } catch (MalformedURLException ex) {
            throw new UpdateException(String.format("Inavlid URL for RetireJS repository (%s)", url), ex);
        } catch (IOException ex) {
            throw new UpdateException("Unable to get the data directory", ex);
        }
        return false;
    }
283524
private void overrideFromSystemProperties() {
        String  url = System.getProperty("activejdbc.url");
        String  user = System.getProperty("activejdbc.user");
        String  password = System.getProperty("activejdbc.password");
        String  driver = System.getProperty("activejdbc.driver");
        if(!blank(url) && !blank(user) && !blank(driver)){
            connectionSpecMap.put(getEnvironment(), new ConnectionJdbcSpec(driver, url, user, password));
        }

        String  jndi = System.getProperty("activejdbc.jndi");
        if(!blank(jndi)){
            connectionSpecMap.put(getEnvironment(), new ConnectionJndiSpec(jndi));
        }
    }
1030312
public boolean updateCatalog(String diffCmds,
                                 CatalogContext context,
                                 boolean requiresSnapshotIsolationboolean,
                                 boolean isMPI,
                                 long txnId,
                                 long uniqueId,
                                 long spHandle,
                                 boolean isReplay,
                                 boolean requireCatalogDiffCmdsApplyToEE,
                                 boolean requiresNewExportGeneration)
    {
        CatalogContext oldContext = m_context;
        m_context = context;
        m_ee.setBatchTimeout(m_context.cluster.getDeployment().get("deployment").
                getSystemsettings().get("systemsettings").getQuerytimeout());
        m_loadedProcedures.loadProcedures(m_context, isReplay);
        m_ee.loadFunctions(m_context);

        if (isMPI) {
            // the rest of the work applies to sites with real EEs
            return true;
        }

        if (requireCatalogDiffCmdsApplyToEE == false) {
            // empty diff cmds for the EE to apply, so skip the JNI call
            hostLog.debug("Skipped applying diff commands on EE.");
            return true;
        }

        CatalogMap<Table> tables = m_context.catalog.getClusters().get("cluster").getDatabases().get("database").getTables();

        boolean DRCatalogChange = false;
        for (Table t : tables) {
            if (t.getIsdred()) {
                DRCatalogChange |= diffCmds.contains("tables#" + t.getTypeName());
                if (DRCatalogChange) {
                    break;
                }
            }
        }

        if (!DRCatalogChange) { // Check against old catalog for deletions
            CatalogMap<Table> oldTables = oldContext.catalog.getClusters().get("cluster").getDatabases().get("database").getTables();
            for (Table t : oldTables) {
                if (t.getIsdred()) {
                    DRCatalogChange |= diffCmds.contains(CatalogSerializer.getDeleteDiffStatement(t, "tables"));
                    if (DRCatalogChange) {
                        break;
                    }
                }
            }
        }

        // if a snapshot is in process, wait for it to finish
        // don't bother if this isn't a schema change
        //
        if (requiresSnapshotIsolationboolean && m_snapshotter.isEESnapshotting()) {
            hostLog.info(String.format("Site %d performing schema change operation must block until snapshot is locally complete.",
                    CoreUtils.getSiteIdFromHSId(m_siteId)));
            try {
                m_snapshotter.completeSnapshotWork(m_sysprocContext);
                hostLog.info(String.format("Site %d locally finished snapshot. Will update catalog now.",
                        CoreUtils.getSiteIdFromHSId(m_siteId)));
            }
            catch (InterruptedException e) {
                VoltDB.crashLocalVoltDB("Unexpected Interrupted Exception while finishing a snapshot for a catalog update.", true, e);
            }
        }

        //Necessary to quiesce before updating the catalog
        //so export data for the old generation is pushed to Java.
        //No need to quiesce as there is no rolling of generation OLD datasources will be polled and pushed until there is no more data.
        //m_ee.quiesce(m_lastCommittedSpHandle);
        m_ee.updateCatalog(m_context.m_genId, requiresNewExportGeneration, diffCmds);
        if (DRCatalogChange) {
            final DRCatalogCommands catalogCommands = DRCatalogDiffEngine.serializeCatalogCommandsForDr(m_context.catalog, -1);
            generateDREvent(EventType.CATALOG_UPDATE, txnId, uniqueId, m_lastCommittedSpHandle,
                    spHandle, catalogCommands.commands.getBytes(Charsets.UTF_8));
        }

        return true;
    }
526450
private void dev_import_without_dbase(final Connection connection) throws DevFailed {
		 if (connection.device == null) {
	    	 try {
                 // Prepare the connection string
                 final String db_corbaloc = "corbaloc:iiop:" + connection.url.host + ":"
                     + connection.url.strPort + "/" + connection.devname.toLowerCase();
                 // System.out.println("db_corbaloc=" + db_corbaloc);

                 // And connect to device.
                 createDevice(connection, db_corbaloc);
                 connection.access = TangoConst.ACCESS_WRITE;
	    	 } catch (final SystemException e) {
                 connection.device = null;
                 connection.ior = null;
                 // e.printStackTrace();
                 Except.throw_connection_failed("TangoApi_DEVICE_CONNECTION_FAILED",
                     "Connection to device without database failed  !\n" + e,
                     "Connection.dev_import_without_dbase(" + connection.url.host + ","
                         + connection.url.strPort + ")");
	    	 }
		 }
    }