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


Java JdbcModelReader类代码示例

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


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

示例1: run

import org.apache.ddlutils.platform.JdbcModelReader; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void run() {
    System.out.println("Indexer: Starting Index Target database");

    System.out.println("Indexer: Connecting to target database...");
    targetDatabaseMock = new TargetDatabaseMock();

    try{
        // Clear all in the service
        AnalyseService service = ServiceProvider.getInstance().getAnalyseService();
        service.clearAllTargetMetadata();

        // Connect and fetch
        TargetConnection targetConnection = ServiceProvider.getInstance().getDaoService().getTargetConnection();
        DataSource dataSource = targetConnection.getDataSource();

        System.out.println("Indexer: Reading database...");
        Platform platform = PlatformFactory.createNewPlatformInstance(dataSource);
        JdbcModelReader modelReader = platform.getModelReader();

        //Database database = modelReader.getDatabase(targetConnection.getConnection(), targetConnection.getSchema(), null, targetConnection.getSchema(), null);
        Database database = targetDatabaseMock.getDatabase();
        service.setTargetDatabaseMetadata(database);

        // Tables loop
        for(Table table : database.getTables()) {
            if (Thread.currentThread().isInterrupted()) {
                System.out.println("Done: Cancelled!");
                return;
            }
            String tableName = table.getName();

            // Add table to list
            service.addTargetTable(tableName, table);

            // Add columns
            ArrayList<Column> columns = new ArrayList<Column>();
            Collections.addAll(columns, table.getColumns());

            // Add to the service
            service.addTargetColumns(table, columns);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    System.out.println("Done: Indexed Target database");

    // Get on main thread and call the callback.
    javafx.application.Platform.runLater(() -> callback.call(null));
}
 
开发者ID:hu-team,项目名称:BusinessRuleGenerator-to,代码行数:53,代码来源:TargetDatabaseTask.java

示例2: getModelReader

import org.apache.ddlutils.platform.JdbcModelReader; //导入依赖的package包/类
/**
 * Returns the model reader (which reads a database model from a live database) for this platform.
 * 
 * @return The model reader
 */
public JdbcModelReader getModelReader();
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:7,代码来源:Platform.java


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