本文整理匯總了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);
}