Creates a new instance for the given database and setting the db pool data.<p>

@param dbUpdater the generic updater part
@param dbName the database to get a new instance for

@return right instance instance for the given database
192464
protected I_CmsUpdateDBPart getInstanceForDb(I_CmsUpdateDBPart dbUpdater, String dbName) {

        String clazz = dbUpdater.getClass().getName();
        int pos = clazz.lastIndexOf('.');
        clazz = clazz.substring(0, pos) + "." + dbName + clazz.substring(pos);
        try {
            return (I_CmsUpdateDBPart)Class.forName(clazz).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
762901
@WithBridgeMethods(value = SQLUpdateClause.class, castRequired = true)
    public C addBatch() {
        batches.add(new SQLUpdateBatch(metadata, updates));
        updates = Maps.newLinkedHashMap();
        metadata = new DefaultQueryMetadata();
        metadata.addJoin(JoinType.DEFAULT, entity);
        return (C) this;
    }
516106
public int update(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException {
		try {
			// there is always and id field as an argument so just return 0 lines updated
			if (argFieldTypes.length <= 1) {
				return 0;
			}
			Object[] args = getFieldObjects(data);
			Object newVersion = null;
			if (versionFieldType != null) {
				newVersion = versionFieldType.extractJavaFieldValue(data);
				newVersion = versionFieldType.moveToNextValue(newVersion);
				args[versionFieldTypeIndex] = versionFieldType.convertJavaFieldToSqlArgValue(newVersion);
			}
			int rowC = databaseConnection.update(statement, args, argFieldTypes);
			if (rowC > 0) {
				if (newVersion != null) {
					// if we have updated a row then update the version field in our object to the new value
					versionFieldType.assignField(connectionSource, data, newVersion, false, null);
				}
				if (objectCache != null) {
					// if we've changed something then see if we need to update our cache
					Object id = idField.extractJavaFieldValue(data);
					T cachedData = objectCache.get(clazz, id);
					if (cachedData != null && cachedData != data) {
						// copy each field from the updated data into the cached object
						for (FieldType fieldType : tableInfo.getFieldTypes()) {
							if (fieldType != idField) {
								fieldType.assignField(connectionSource, cachedData,
										fieldType.extractJavaFieldValue(data), false, objectCache);
							}
						}
					}
				}
			}
			logger.debug("update data with statement '{}' and {} args, changed {} rows", statement, args.length, rowC);
			if (args.length > 0) {
				// need to do the (Object) cast to force args to be a single object
				logger.trace("update arguments: {}", (Object) args);
			}
			return rowC;
		} catch (SQLException e) {
			throw SqlExceptionUtil.create("Unable to run update stmt on object " + data + ": " + statement, e);
		}
	}
1003016
public static Object createBlob(Connection conn) throws MjdbcSQLException {
        Object result = null;

        try {
            result = MappingUtils.invokeFunction(conn, "createBlob", new Class[]{}, new Object[]{});
        } catch (MjdbcException ex) {
            throw new MjdbcSQLException("createBlob is not supported by JDBC Driver", ex);
        }

        return result;
    }
652096
@NotNull
    public DbPreparedStatement<T> set(@NotNull String name, @Nullable DbInt value) throws SQLException {
        return value == null ? setNull(name, JDBCType.INTEGER) : set(name, value.getDbValue());
    }
542574
private static void createDB(String dbName) {
        // remove database if it exists
        if (ZooHelper.dbExists(dbName)) {
            ZooHelper.removeDb(dbName);
        }

        // create database
        // By default, all database files will be created in %USER_HOME%/zoodb
        ZooHelper.createDb(dbName);
    }
411694
public static DBContext onlineInstance(String name) {
    DB db = DBMaker
        .fileDB(name)
        .fileMmapEnableIfSupported()
        .closeOnJvmShutdown()
        .transactionEnable()
        .make();

    return new MapDBContext(db);
  }
1179273
public static Updater createUpdater(String expression) {
        try {
            return INSTANCE.ctorUpdater.newInstance(expression);
        }
        catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
1000838
public static AbstractInsertParser newInstance(final DatabaseType dbType, final ShardingRule shardingRule, final LexerEngine lexerEngine, final ShardingTableMetaData shardingTableMetaData) {
        switch (dbType) {
            case H2:
            case MySQL:
                return new MySQLInsertParser(shardingRule, lexerEngine, shardingTableMetaData);
            case Oracle:
                return new OracleInsertParser(shardingRule, lexerEngine, shardingTableMetaData);
            case SQLServer:
                return new SQLServerInsertParser(shardingRule, lexerEngine, shardingTableMetaData);
            case PostgreSQL:
                return new PostgreSQLInsertParser(shardingRule, lexerEngine, shardingTableMetaData);
            default:
                throw new UnsupportedOperationException(String.format("Cannot support database [%s].", dbType));
        }
    }
1066604
public int create(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException {
		if (mappedInsert == null) {
			mappedInsert = MappedCreate.build(dao, tableInfo);
		}
		int result = mappedInsert.insert(databaseType, databaseConnection, data, objectCache);
		if (dao != null && !localIsInBatchMode.get()) {
			dao.notifyChanges();
		}
		return result;
	}
945117
public int[] batchUpdate(String tableName, List<Record> recordList, int batchSize) {
    	return batchUpdate(tableName, config.dialect.getDefaultPrimaryKey(),recordList, batchSize);
    }
755884
public void update(SuperCfUpdater<K, SN, N> updater) {
    updater.updateInternal();
    updater.update();    
    executeIfNotBatched(updater.getCurrentMutator());
  }
801622
protected DaoResult updateOrCreate(Connection conn, T bo) {
        if (bo == null) {
            return new DaoResult(DaoOperationStatus.NOT_FOUND);
        }
        DaoResult result = update(conn, bo);
        DaoOperationStatus status = result.getStatus();
        if (status == DaoOperationStatus.NOT_FOUND) {
            result = create(conn, bo);
        }
        return result;
    }
1213560
public static base_response update(nitro_service client, dbdbprofile resource) throws Exception {
		dbdbprofile updateresource = new dbdbprofile();
		updateresource.name = resource.name;
		updateresource.interpretquery = resource.interpretquery;
		updateresource.stickiness = resource.stickiness;
		updateresource.kcdaccount = resource.kcdaccount;
		updateresource.conmultiplex = resource.conmultiplex;
		return updateresource.update_resource(client);
	}
773132
@Override
  public final void createDatabase(final String pDbName,
    final int pDbId) throws Exception {
    String dbNm = this.databasePrefix + pDbName + ".sqlite";
    synchronized (this.factoryAppBeans) {
      if (!this.factoryAppBeans.getDatabaseName().equals(dbNm)) {
        this.factoryAppBeans.setDatabaseName(dbNm);
        this.factoryAppBeans.setNewDatabaseId(pDbId);
        this.factoryAppBeans.handleDatabaseChanged();
      }
    }
  }
329679
private void updateDb(String dbName, String webapp) {

        m_mainLayout.removeAllComponents();
        m_setupBean.setDatabase(dbName);
        CmsDbSettingsPanel panel = new CmsDbSettingsPanel(m_setupBean);
        m_panel[0] = panel;
        panel.initFromSetupBean(webapp);
        m_mainLayout.addComponent(panel);
    }
659733
@CheckReturnValue
  public static Builder fromPool(Pool pool) {
    return new BuilderImpl(pool.poolShutdown, () -> {
      try {
        return pool.dataSource.getConnection();
      } catch (Exception e) {
        throw new DatabaseException("Unable to obtain a connection from the DataSource", e);
      }
    }, new OptionsDefault(pool.flavor));
  }