AmbiguousTableNameException

March 20th, 2009

Applies to:
DBUnit

Description:
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

Cause:
a. No schema is specified.
B. Your database contains two tables whose names only differ by case, e.g. “userlist” and “UserList”. DBUnit handles table names case-insensitively and gets confused. This can happen on database systems that are case-sensitive for identifiers, e.g. MySQL and (possibly) Microsoft SQL Server.

admin JAVA-DBUnit

  1. admin
    March 20th, 2009 at 10:28 | #1

    a. 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.

    b. Remove or rename one of the offending tables. DBUnit handles table names case-insensitively and cannot handle tables whose names only differ by case.

  1. No trackbacks yet.