本文整理汇总了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();
}
示例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);
}
}
示例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();
}
示例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;
}
};
}
示例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));
}
示例6: getSqlBuilder
import org.apache.ddlutils.platform.SqlBuilder; //导入依赖的package包/类
/**
* Returns the sql builder for the this platform.
*
* @return The sql builder
*/
public SqlBuilder getSqlBuilder();
示例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();
}
示例8: getDdlSqlBuilder
import org.apache.ddlutils.platform.SqlBuilder; //导入依赖的package包/类
protected abstract SqlBuilder getDdlSqlBuilder(String schema, Platform platform);