本文整理汇总了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!");
}
}
示例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!");
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例7: createQueryTable
import org.dbunit.database.IDatabaseConnection; //导入方法依赖的package包/类
public ITable createQueryTable(IDatabaseConnection conn, String resultName, String query)
throws Exception
{
return conn.createQueryTable(resultName, query);
}