• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DBUnit question - NoSuchTableException

 
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for sharing, Melinda. I'm sure this will save a lot of time for those who come after you!
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic