We are trying to get DBUnit up and working within our environment on our local development systems. We are running sql server locally on our PC's and have created numerous schemas in trying to replicate the relational-like tables that exist on a mainframe(YUK). The problem I am running into appears to be, though not 100% certain, with the JDBC driver for sql server 2000. I am getting a "NoSuchTableException" when I enter the SCHEMA.TABLE_NAME format in my seed-xml file and put in the SYSTEM.SETPROPERTY("dbunit.qualified.table.name", "true"); in my test class in order for DBUNIT to recognize the format of using the SCHEMA.TABLE_NAME format before each column name. I am having to deal with testing multiple schemas in my select statements.
When I remove the SCHEMA.TABLE_NAME from the see-xml file then my DBUnit test runs fine but when I run it with the SCHEMA.TABLE_NAME it blows chow. Unfortunately I'm spinning my wheels now and could really use the input.
In case anyone is interested in the solution that I finally found to my original problem, I found, buried deep in the DBUnit documentation, that the SYSTEM.SETPROPERTY is no longer available in DBUnit to handle multiple schemas.
Now you in your getConnection method to enter the following:
That which is in BOLD was the key solution as well as entering the SCHEMA.TABLENAMES in your xml file and .dtd file.
I hope that helps someone when dealing with DBUnit and MULTIPLE SCHEMAS.
Joined: Jan 23, 2002
Thanks for sharing, Melinda. I'm sure this will save a lot of time for those who come after you!
I've tried the same thing, but we use MySQL 5 here. I'm still getting a NoSuchTable error. I read on another forum somewhere, that someone could run his test with Postgree, but had trouble with MySQL. Someone else told him to use DBUnit 2.4.4, but I tried that and I still get the same error.
Is it possible to make DBUnit insert records in 2 different MySQL DataBases/Schemas?