当前位置: 首页>>代码示例>>Java>>正文


Java SqlBuilder类代码示例

本文整理汇总了Java中org.apache.ddlutils.platform.SqlBuilder的典型用法代码示例。如果您正苦于以下问题:Java SqlBuilder类的具体用法?Java SqlBuilder怎么用?Java SqlBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SqlBuilder类属于org.apache.ddlutils.platform包,在下文中一共展示了SqlBuilder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeAllDDLs

import org.apache.ddlutils.platform.SqlBuilder; //导入依赖的package包/类
@Override
protected void writeAllDDLs(Connection conn, Writer writer, boolean exportAll)
    throws SQLException, IOException {
  CallableStatement cstmt = conn.prepareCall("call SYS.EXPORT_DDLS(?)");
  cstmt.setBoolean(1, exportAll);
  ResultSet rs = cstmt.executeQuery();
  while (rs.next()) {
    writer.write(rs.getString(3));
    writer.write(';');
    writer.write(SqlBuilder.LINE_SEPARATOR);
    writer.write(SqlBuilder.LINE_SEPARATOR);
  }
  rs.close();
  writer.flush();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:16,代码来源:GemFireXDPlatform.java

示例2: writeAddIdentityUsingAlterTable

import org.apache.ddlutils.platform.SqlBuilder; //导入依赖的package包/类
protected void writeAddIdentityUsingAlterTable(Platform platform,
    Database model) throws DataSinkException {
  // if identity column has to be set using alter table then
  // do it after loading the data
  if (_addIdentityUsingAlterTable && platform.getPlatformInfo()
          .isAddingIdentityUsingAlterTableSupported()) {
    StringWriter buffer = new StringWriter();
  
    SqlBuilder builder = platform.getSqlBuilder();
    builder.setWriter(buffer);
    for (int index = 0; index < model.getTableCount(); index++) {
      Table table = model.getTable(index);
      for (int col = 0; col < table.getColumnCount(); col++) {
        Column column = table.getColumn(col);
        if (column.isAutoIncrement()) {
          try {
            builder.writeAddIdentityColumnUsingAlterTable(table, column);
          } catch (IOException ioe) {
            throw new DataSinkException(ioe);
          }
        }
      }
    }
    String sql = buffer.toString();
    platform.evaluateBatch(sql, false);
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:28,代码来源:WriteDataToDatabaseCommand.java

示例3: constructInsertSingleTable

import org.apache.ddlutils.platform.SqlBuilder; //导入依赖的package包/类
private String constructInsertSingleTable(Table table, StructuredStore store, SqlBuilder sqlBuilder) {
    StringBuilder ret = new StringBuilder();
    List<Map<String, Object>> allData = store.selectRows(table.getName(), null, null, null, null, -1);
    for (Map<String, Object> row : allData) {
        ret.append(sqlBuilder.getInsertSql(table, row, false) + "\n");
    }
    return ret.toString();
}
 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:9,代码来源:StandardSqlGenerator.java

示例4: setup

import org.apache.ddlutils.platform.SqlBuilder; //导入依赖的package包/类
@Before
public void setup() {
    sqlGenerator = new StandardSqlGenerator() {
        @Override
        public String constructRenameTableColumns(String schema, String table, Map<String, String> columns) {
            return null;
        }

        @Override
        protected SqlBuilder getDdlSqlBuilder(String schema, Platform platform) {
            // TODO Auto-generated method stub
            return null;
        }
    };
}
 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:16,代码来源:StandardSqlGeneratorTest.java

示例5: getDatabaseAndSqlBuilderPair

import org.apache.ddlutils.platform.SqlBuilder; //导入依赖的package包/类
private Pair<Database, SqlBuilder> getDatabaseAndSqlBuilderPair(String schema, DataSource dataSource) {
    Platform platform = PlatformFactory.createNewPlatformInstance(dataSource);
    return Pair.of(platform.readModelFromDatabase(null, null, caseConverter.convert(schema), null), getDdlSqlBuilder(schema, platform));
}
 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:5,代码来源:StandardSqlGenerator.java

示例6: getSqlBuilder

import org.apache.ddlutils.platform.SqlBuilder; //导入依赖的package包/类
/**
 * Returns the sql builder for the this platform.
 * 
 * @return The sql builder
 */
public SqlBuilder getSqlBuilder();
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:7,代码来源:Platform.java

示例7: getSqlBuilder

import org.apache.ddlutils.platform.SqlBuilder; //导入依赖的package包/类
/**
 * Returns the SQL builder of the tested platform.
 * 
 * @return The builder object
 */
protected SqlBuilder getSqlBuilder()
{
    return getPlatform().getSqlBuilder();
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:10,代码来源:TestPlatformBase.java

示例8: getDdlSqlBuilder

import org.apache.ddlutils.platform.SqlBuilder; //导入依赖的package包/类
protected abstract SqlBuilder getDdlSqlBuilder(String schema, Platform platform); 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:2,代码来源:StandardSqlGenerator.java


注:本文中的org.apache.ddlutils.platform.SqlBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。