公司准备把数据库把MYSQL换成oracle。 系统有用dbunit写的测试DAO的代码。 但跑起来的时候总是有AmbiguousTableNameException 这个一场抛出在CLEAN_INSTALL的时候。上网找了
http://dbunit.sourceforge.net/faq.html#ambiguoustablenameexception
引用
Why I get a "AmbiguousTableNameException"?
This error occurs when no schema is specified and that DbUnit detect that it is getting columns information from multiple tables having the same name and located in different schemas.
You can solve this problem in three different ways:
1. Provide the schema name when creating the database connection. Note that for Oracle you must specify the schema name in uppercase.
2. Ensure that the connection is restricted to access only one schema.
3. Enable the qualified table names feature.
开始的时候以为这里的database connection是javax里的Connection。 其实这里的是dbunit里面的IDatabaseConnection dbUnitConn = new DatabaseConnection(conn);
换成new DatabaseConnection(conn,
SCHEMA_NAME) 就ok了。 注意SCHMEA_NAME需要大写。
分享到:
相关推荐
DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类DBUNIT 基类...
最新的最全的dbunit jar包以及入门教程
dbunit-2.4.9 源码 http://www.dbunit.org/apidocs/index.html 代码 API
DBUNIT使用的详细文档
dbunit开发文档,供需要用dbunit进行开发的人使用
dbunit的jar包,版本2.2
dbunit入门实例 dbunit入门实例 dbunit入门实例 dbunit入门实例
Junit,dbunit单元测试jar包
dbunit2.2完全包 数据库单元测试
Dbunit 基本原理就是在跑测试用例运行之前对数据表做用户定义的操作,清空不想要的数据,插入用户自定义的数据,使得该数据表处于用户知道的一种状态。而用户自定义的数据使用项目里的一个 xml 文件来表示。 Xml ...
文档是关于DBUnit的ant的使用文档,通俗易懂
dbunit-2.2.3..jar dbunit-2.4.2.jar dbunit-2.5.3.jar dbunit-2.7.0.jar 发现每个版本对JDK是有要求的,比如2.7 只能用于JDK1.8版本,所以整理好几个jar包挑选适合自己的
直接从http://www.dbunit.org/apidocs/index.html上下载的HTML文件的压缩包。 因为没有做成CHM,所以只要1分就行~
一个很好的DBUnit的例子 博文链接:https://virgoooos.iteye.com/blog/186859
dbunit是一个基于junit扩展的数据库测试框架。 更多资源详见: http://blog.csdn.net/fanxiaobin577328725/article/details/51894331 (包含图书各部分和随书源码,还有其它资源的详细下载地址)
dbunit使用必需Jar包,总共4个必需Jar包
dbunit-2.4.2.jar dbunit 必要的一个jar
用dbunit的两个例子,很不错,有帮助
dbunit测试demo,具体可以结合博文https://i.cnblogs.com/EditPosts.aspx?postid=10653984
通过DBUNIT做批量对比测试