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


Java IDatabaseConnection.createQueryTable方法代码示例

本文整理汇总了Java中org.dbunit.database.IDatabaseConnection.createQueryTable方法的典型用法代码示例。如果您正苦于以下问题:Java IDatabaseConnection.createQueryTable方法的具体用法?Java IDatabaseConnection.createQueryTable怎么用?Java IDatabaseConnection.createQueryTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.dbunit.database.IDatabaseConnection的用法示例。


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

示例1: testInvalidQuery

import org.dbunit.database.IDatabaseConnection; //导入方法依赖的package包/类
@Test
public void testInvalidQuery() throws Exception {

    logger.info("-------------------- Test Invalid Query --------------------");
    String queryFolder = getQueryFolderPrefix() + "src/test/resources/query/sql_invalid";
    List<File> sqlFiles = getFilesFromFolder(new File(queryFolder), ".sql");
    for (File sqlFile : sqlFiles) {
        String queryName = StringUtils.split(sqlFile.getName(), '.')[0];
        logger.info("Testing Query " + queryName);
        String sql = getTextFromFile(sqlFile);
        IDatabaseConnection cubeConn = new DatabaseConnection(cubeConnection);
        try {
            cubeConn.createQueryTable(queryName, sql);
        } catch (Throwable t) {
            continue;
        } finally {
            cubeConn.close();
        }
        throw new IllegalStateException(queryName + " should be error!");
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:22,代码来源:ITKylinQueryTest.java

示例2: testInvalidQuery

import org.dbunit.database.IDatabaseConnection; //导入方法依赖的package包/类
@Test
public void testInvalidQuery() throws Exception {

    printInfo("-------------------- Test Invalid Query --------------------");
    String queryFolder = "src/test/resources/query/sql_invalid";
    List<File> sqlFiles = getFilesFromFolder(new File(queryFolder), ".sql");
    for (File sqlFile : sqlFiles) {
        String queryName = StringUtils.split(sqlFile.getName(), '.')[0];
        printInfo("Testing Query " + queryName);
        String sql = getTextFromFile(sqlFile);
        IDatabaseConnection cubeConn = new DatabaseConnection(cubeConnection);
        try {
            cubeConn.createQueryTable(queryName, sql);
        } catch (Throwable t) {
            continue;
        } finally {
            cubeConn.close();
        }
        throw new IllegalStateException(queryName + " should be error!");
    }
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:22,代码来源:KylinQueryTest.java

示例3: getObjectEventByEpc

import org.dbunit.database.IDatabaseConnection; //导入方法依赖的package包/类
public static ITable getObjectEventByEpc(IDatabaseConnection connection, String epc) throws Exception {
    String sql = "SELECT event.eventTime, epc.epc FROM `event_objectevent_epcs` epc, `event_objectevent` event WHERE epc.event_id=event.id AND epc.epc='" + epc +"'";
    ITable table = connection.createQueryTable("SingleObjectEvent", sql);
    return table;
}
 
开发者ID:Fosstrak,项目名称:fosstrak-epcis,代码行数:6,代码来源:FosstrakDatabaseHelper.java

示例4: getTransactionEventByEpc

import org.dbunit.database.IDatabaseConnection; //导入方法依赖的package包/类
public static ITable getTransactionEventByEpc(IDatabaseConnection connection, String epc) throws Exception {
    String sql = "SELECT event.eventTime, epc.epc FROM `event_transactionevent_epcs` epc, `event_transactionevent` event WHERE epc.event_id=event.id AND epc.epc='" + epc +"'";
    ITable table = connection.createQueryTable("SingleTransactionEvent", sql);
    return table;
}
 
开发者ID:Fosstrak,项目名称:fosstrak-epcis,代码行数:6,代码来源:FosstrakDatabaseHelper.java

示例5: getQuantityEventByEpcClass

import org.dbunit.database.IDatabaseConnection; //导入方法依赖的package包/类
public static ITable getQuantityEventByEpcClass(IDatabaseConnection connection, String epcClass) throws Exception {
    String sql = "SELECT event.eventTime, epc.uri FROM `voc_epcclass` epc, `event_quantityevent` event WHERE epc.id=event.epcClass AND epc.uri='" + epcClass +"'";
    ITable table = connection.createQueryTable("SingleQuantityEvent", sql);
    return table;
}
 
开发者ID:Fosstrak,项目名称:fosstrak-epcis,代码行数:6,代码来源:FosstrakDatabaseHelper.java

示例6: getAggregationEventByChildEpc

import org.dbunit.database.IDatabaseConnection; //导入方法依赖的package包/类
public static ITable getAggregationEventByChildEpc(IDatabaseConnection connection, String epc) throws Exception {
    String sql = "SELECT event.eventTime, epc.epc FROM `event_aggregationevent_epcs` epc, `event_aggregationevent` event WHERE epc.event_id=event.id AND epc.epc='" + epc +"'";
    ITable table = connection.createQueryTable("SingleAggregationEvent", sql);
    return table;
}
 
开发者ID:Fosstrak,项目名称:fosstrak-epcis,代码行数:6,代码来源:FosstrakDatabaseHelper.java

示例7: createQueryTable

import org.dbunit.database.IDatabaseConnection; //导入方法依赖的package包/类
public ITable createQueryTable(IDatabaseConnection conn, String resultName, String query)
        throws Exception
{
    return conn.createQueryTable(resultName, query);
}
 
开发者ID:NCIP,项目名称:cadsr-semantic-tools,代码行数:6,代码来源:DBTestCase.java


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