GeeCON Prague 2014*
The moose likes Testing and the fly likes DBUnit question - NoSuchTableException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Testing
Bookmark "DBUnit question - NoSuchTableException" Watch "DBUnit question - NoSuchTableException" New topic
Author

DBUnit question - NoSuchTableException

Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 387

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.

Any help or direction would be appreciated.

Regards.
[ May 02, 2006: Message edited by: Melinda Savoy ]
Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 387

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.

Thanks.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Thanks for sharing, Melinda. I'm sure this will save a lot of time for those who come after you!


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Henrique Ordine
Ranch Hand

Joined: Sep 03, 2004
Posts: 127
Hi Melinda,

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?

Thanks in advance.


J2EE Architect/Developer
 
GeeCON Prague 2014
 
subject: DBUnit question - NoSuchTableException