Examples of DbDialect


Examples of com.alibaba.otter.node.etl.common.db.dialect.DbDialect

     * @param eventDatas
     */
    private void doDdl(DbLoadContext context, List<EventData> eventDatas) {
        for (final EventData data : eventDatas) {
            DataMedia dataMedia = ConfigHelper.findDataMedia(context.getPipeline(), data.getTableId());
            final DbDialect dbDialect = dbDialectFactory.getDbDialect(context.getIdentity().getPipelineId(),
                (DbMediaSource) dataMedia.getSource());
            Boolean skipDdlException = context.getPipeline().getParameters().getSkipDdlException();
            try {
                Boolean result = dbDialect.getJdbcTemplate().execute(new StatementCallback<Boolean>() {

                    public Boolean doInStatement(Statement stmt) throws SQLException, DataAccessException {
                        Boolean result = false;
                        if (dbDialect instanceof MysqlDialect && StringUtils.isNotEmpty(data.getDdlSchemaName())) {
                            // 如果mysql,执行ddl时,切换到在源库执行的schema上
View Full Code Here

Examples of com.opengamma.util.db.DbDialect

    DbConnector connector = s_connectors.get(key);
    if (connector == null) {
      synchronized (this) {
        connector = s_connectors.get(key);
        if (connector == null) {
          DbDialect dbDialect = DbDialectUtils.getSupportedDbDialect(getDatabaseType());
          DbConnectorFactoryBean factory = new DbConnectorFactoryBean();
          factory.setName("DbTest-" + dbDialect.getName() + (scope != null ? "-" + scope.getSimpleName() : ""));
          factory.setDialect(dbDialect);
          factory.setDataSource(getDbTool().getDataSource());
          factory.setTransactionIsolationLevelName("ISOLATION_READ_COMMITTED");
          factory.setTransactionPropagationBehaviorName("PROPAGATION_REQUIRED");
          initDbConnectorFactory(factory);
View Full Code Here

Examples of com.opengamma.util.db.DbDialect

   *
   * @param databaseType  the database type, not null
   * @return the dialect, not null
   */
  public static DbDialect getSupportedDbDialect(String databaseType) {
    DbDialect dbDialect = getSupportedDbDialects().get(databaseType);
    if (dbDialect == null) {
      throw new OpenGammaRuntimeException("Config error - no DbDialect setup for " + databaseType);
    }
    return dbDialect;
  }
View Full Code Here

Examples of com.opengamma.util.db.DbDialect

    Collection<String> databaseTypes = Sets.newHashSet(s_dbDialects.keySet());
    for (Iterator<String> it = databaseTypes.iterator(); it.hasNext(); ) {
      String dbType = it.next();
      Boolean available = s_availableDialects.get(dbType);
      if (available == null) {
        DbDialect dbDialect = s_dbDialects.get(dbType);
        try {
          Objects.requireNonNull(dbDialect.getJDBCDriverClass());
          available = true;
        } catch (RuntimeException | Error ex) {
          available = false;
          System.err.println("Database driver not available: " + dbType);
        }
View Full Code Here

Examples of com.opengamma.util.db.DbDialect

   *
   * @param databaseType  the database type, not null
   * @return the dialect, not null
   */
  public static DbDialect getAvailableDbDialect(String databaseType) {
    DbDialect dbDialect = getAvailableDbDialects().get(databaseType);
    if (dbDialect == null) {
      throw new OpenGammaRuntimeException("Config error - no available DbDialect for " + databaseType);
    }
    return dbDialect;
  }
View Full Code Here

Examples of com.opengamma.util.db.DbDialect

    }
    initDbConnector(repo);
  }
 
  protected DbConnector initDbConnector(ComponentRepository repo) {
    DbDialect dialect = createDialect();
    NamedParameterJdbcTemplate jdbcTemplate = new NamedParameterJdbcTemplate(getDataSource());
    SessionFactory hibernateSessionFactory = createHibernateSessionFactory(dialect);
    HibernateTemplate hibernateTemplate = createHibernateTemplate(hibernateSessionFactory);
    TransactionTemplate transactionTemplate = createTransactionTemplate(hibernateSessionFactory);
    DbConnector dbConnector = new DbConnector(getName(), dialect, getDataSource(), jdbcTemplate, hibernateTemplate, transactionTemplate);
View Full Code Here

Examples of org.geotools.gce.imagemosaic.jdbc.DBDialect

                // TODO: we may consider adding support for external folder where to store both config file
                // and script file
                createConfigFile(configFile);
                config = Config.readFrom(url);
                DBDialect dialect = DBDialect.getDBDialect(config);
                connection = dialect.getConnection();

                // Step 3: configure raster into DB in case they haven't been imported by hand
                // Manual import may be preferred by the user when dealing with huge datasets
                if (!isMosaicAlreadyInDB(connection)) {
                    if (LOGGER.isLoggable(Level.FINE)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.