當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。