2007-06-14
Dbunit在Oracle下需要注意的问题
关键字: dbunit oracle
公司准备把数据库把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需要大写。
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需要大写。
- 浏览: 220226 次
- 性别:

- 来自: 广州

- 详细资料
搜索本博客
我的相册
VB-seamless
共 13 张
共 13 张
最近加入圈子
最新评论
-
使用Terracotta和Tomcat建 ...
renavatior 写道"运行start.bat 9081 这样我们就启动了目 ...
-- by rainsf -
使用Terracotta和Tomcat建 ...
"运行start.bat 9081 这样我们就启动了目录9081中的tomcat ...
-- by renavatior -
广州3年多经验 5500的 ...
fucku 写道广州的软件厂家可比深圳多多了,不过比起北京上海来,还是少了很多, ...
-- by yongfan_420 -
广州3年多经验 5500的 ...
广州的软件厂家可比深圳多多了,不过比起北京上海来,还是少了很多,导致机会也没有这 ...
-- by fucku -
广州3年多经验 5500的 ...
想高工资就去厂家咯,老在集成商里面混能有多大个奔头
-- by fucku






评论排行榜