Examples of DbType


Examples of com.taobao.tddl.interact.rule.bean.DBType

    Map<String, DataSourceWrapper> dataSourceMap = new HashMap<String, DataSourceWrapper>(
        list.size());
    Map<String, Integer> weightMap = new HashMap<String, Integer>(
        list.size());

    DBType dbType = null;
    for (DataSourceWrapper dsw : list) {
      String dsKey = dsw.getDataSourceKey();
      dataSourceMap.put(dsKey, dsw);
      weightMap
          .put(dsKey, isRead ? dsw.getWeight().r : dsw.getWeight().w);
View Full Code Here

Examples of com.taobao.tddl.interact.rule.bean.DBType

          return dataSourceFetcher.getDataSource(key);
        }

        @Override
        public DBType getDataSourceDBType(String key) {
          DBType type = dataSourceFetcher.getDataSourceDBType(key);
          return type == null ? dbType : type; //���dataSourceFetcherûdbType����tgds��dbType
        }
      };
      List<DataSourceWrapper> dss = ConfigManager.buildDataSourceWrapper(dsKeyAndWeightCommaArray, wrapper);
      init(dss);
View Full Code Here

Examples of com.tll.criteria.DBType

            case IS:
              if(checkValue instanceof DBType == false) {
                throw new InvalidCriteriaException("IS clauses support only check values of type: "
                    + DBType.class.getSimpleName());
              }
              final DBType dbType = (DBType) checkValue;
              if(dbType == DBType.NULL) {
                // null
                pquery.constrain(null);
              }
              else {
View Full Code Here

Examples of com.tll.util.DBType

          case IS:
            if(checkValue instanceof DBType == false) {
              throw new InvalidCriteriaException("IS clauses support only check values of type: "
                  + DBType.class.getSimpleName());
            }
            final DBType dbType = (DBType) checkValue;
            if(dbType == DBType.NULL) {
              // null
              pquery.constrain(null);
            }
            else {
View Full Code Here

Examples of de.zalando.typemapper.core.db.DbType

            values = ParseUtils.postgresROW2StringList(value);
        } catch (final RowParserException e) {
            throw new SQLException(e);
        }

        final DbType dbType = DbTypeRegister.getDbType(typeId, connection);
        int i = 1;
        for (final String fieldValue : values) {
            if (dbType == null) {
                final String error = "dbType is null for typename: " + typeName;
                LOG.error(error);
                throw new NullPointerException(error);
            }

            final DbTypeField fieldDef = dbType.getFieldByPos(i);
            DbResultNode node = null;
            if (fieldDef == null) {
                LOG.error("Could not find field in {} for pos ", dbType, i);
                continue;
            }
View Full Code Here

Examples of de.zalando.typemapper.core.db.DbType

        final Field[] fields = getFields(clazz);
        Map<String, DbTypeField> dbFields = null;

        if (connection != null) {
            try {
                final DbType dbType = DbTypeRegister.getDbType(typeName, connection);
                dbFields = new HashMap<String, DbTypeField>();
                for (final DbTypeField dbfield : dbType.getFields()) {
                    dbFields.put(dbfield.getName(), dbfield);
                }
            } catch (final Exception e) {
                throw new IllegalArgumentException("Could not get PG type information for " + typeName, e);
            }
View Full Code Here

Examples of org.apache.oozie.util.db.Schema.DBType

            return idxCol;
        }
    }

    public static void prepareDB(Connection conn) throws SQLException {
        DBType type = DBType.ORACLE;
        if (Schema.isHsqlConnection(conn)) {
            type = DBType.HSQL;
        }
        else {
            if (Schema.isMySqlConnection(conn)) {
                type = DBType.MySQL;
            }
        }

        if (!type.equals(DBType.ORACLE)) {
            conn.prepareStatement(
                    "CREATE " + (type.equals(DBType.MySQL) ? "DATABASE " : "SCHEMA ") + DB_NAME
                            + (type.equals(DBType.HSQL) ? " AUTHORIZATION DBA" : "")).execute();
        }
        for (Table table : TABLE_COLUMNS.keySet()) {
            String createStmt = Schema.generateCreateTableScript(table, type, TABLE_COLUMNS.get(table));
            conn.prepareStatement(createStmt).execute();
        }
View Full Code Here

Examples of org.apache.oozie.util.db.Schema.DBType

            conn.prepareStatement(createStmt).execute();
        }
    }

    public static void dropSchema(Connection conn) throws SQLException {
        DBType type = DBType.ORACLE;
        if (Schema.isHsqlConnection(conn)) {
            type = DBType.HSQL;
        }
        else {
            if (Schema.isMySqlConnection(conn)) {
                type = DBType.MySQL;
            }
            else {
                // do not drop database for oracle, only drop tables
                dropTables(conn);
                return;
            }
        }

        conn.prepareStatement("DROP " + ((type.equals(DBType.MySQL) || type.equals(DBType.ORACLE)) ? "DATABASE " : "SCHEMA ") +
                ((type.equals(DBType.MySQL) || type.equals(DBType.HSQL)) ? DB_NAME : "") +
                (type.equals(DBType.HSQL) ? " CASCADE" : "")).execute();
    }
View Full Code Here

Examples of org.apache.oozie.util.db.Schema.DBType

                ((type.equals(DBType.MySQL) || type.equals(DBType.HSQL)) ? DB_NAME : "") +
                (type.equals(DBType.HSQL) ? " CASCADE" : "")).execute();
    }

    public static void dropTables(Connection conn) throws SQLException {
        DBType type = DBType.ORACLE;
        if (Schema.isHsqlConnection(conn)) {
            type = DBType.HSQL;
        }
        else {
            if (Schema.isMySqlConnection(conn)) {
View Full Code Here

Examples of org.apache.oozie.util.db.Schema.DBType

            return idxCol;
        }
    }

    public static void prepareDB(Connection conn) throws SQLException {
        DBType type = DBType.ORACLE;
        if (Schema.isHsqlConnection(conn)) {
            type = DBType.HSQL;
        }
        else {
            if (Schema.isMySqlConnection(conn)) {
                type = DBType.MySQL;
            }
        }

        if (!type.equals(DBType.ORACLE)) {
            conn.prepareStatement(
                    "CREATE " + (type.equals(DBType.MySQL) ? "DATABASE " : "SCHEMA ") + DB_NAME
                            + (type.equals(DBType.HSQL) ? " AUTHORIZATION DBA" : "")).execute();
        }
        for (Table table : TABLE_COLUMNS.keySet()) {
            String createStmt = Schema.generateCreateTableScript(table, type, TABLE_COLUMNS.get(table));
            conn.prepareStatement(createStmt).execute();
        }
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.