|
From: Quinten V. <q.v...@ri...> - 2005-08-02 15:32:52
|
To answer your question...
=20
I'm assuming you are talking about catalogs because in my case the SQL =
Server schema (dbo) is the same for any catalog. I have the habit =
changing catalogs on the same connection by using the fully qualified =
naming convention on SQL level (database.schema.table), although this =
approach can have some disadvantages (e.g. catalogs must remain on same =
server).
Hence me thinking I could provide the catalog in the xml dataset.
Thx for the feedback,
Quinten
-----Original Message-----
From: Shane Mingins [mailto:Sha...@as...]
Sent: 01 August 2005 22:35
To: dbu...@li...
Subject: RE: [dbunit-user] using scheme names in xml dataset
I am using an As400 database (which does not help you much) ... one way =
I can get this error is to remove one of the schemas from my JDBC =
connection string.
=20
How do you indicate to your database connection that is has multiple =
schema's? Could this be the problem?=20
=20
Cheers
Shane
=20
=20
-----Original Message-----
From: dbu...@li... =
[mailto:dbu...@li...] On Behalf Of Quinten =
Verheyen
Sent: Monday, 1 August 2005 9:32 p.m.
To: dbu...@li...
Subject: RE: [dbunit-user] using scheme names in xml dataset
=20
Well, thx for the answer but it can't be that, the setting of the =
qualified table names feature happens, but it just doesn't seem to help =
me.
=20
The docs say the following about this feature : "Enable or disable =
multiple schemas support. If enabled, Dbunit access tables with names =
fully qualified by schema using this format: SCHEMA.TABLE".
=20
Yet, I keep getting this exception :
=20
org.dbunit.dataset.NoSuchTableException: MyScheme.MyTable
at =
org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java=
:192)
at =
org.dbunit.operation.AbstractOperation.getOperationMetaData(AbstractOpera=
tion.java:59)
at =
org.dbunit.operation.AbstractBatchOperation.execute(AbstractBatchOperatio=
n.java:129)
at =
org.dbunit.DatabaseTestCase.executeOperation(DatabaseTestCase.java:87)
at org.dbunit.DatabaseTestCase.setUp(DatabaseTestCase.java:104)
=20
To show how I set things up :
=20
protected DatabaseOperation getSetUpOperation() throws Exception {
// fetching DAO
return DatabaseOperation.INSERT;
}
=20
protected DatabaseOperation getTearDownOperation() throws Exception {
return DatabaseOperation.DELETE;
}
=20
protected IDatabaseConnection getConnection() throws Exception {
// fecthing java.sql.Connection from DAO
IDatabaseConnection dbConnection =3D new =
DatabaseConnection(connection);
=
dbConnection.getConfig().setFeature(DatabaseConfig.FEATURE_QUALIFIED_TABL=
E_NAMES, true);
return dbConnection;
}
=20
protected IDataSet getDataSet() throws Exception { =20
System.out.println( =
getConnection().getConfig().getFeature(DatabaseConfig.FEATURE_QUALIFIED_T=
ABLE_NAMES) ); // prints out "true"
// make File object from flat dataset xml
return expectedDataSet =3D new FlatXmlDataSet( myFile );
}
=20
Maybe it isn't the idea to use multiple schemes in flat xml datasets ? =
(but only for retreiving data for example). Would surprise me, config =
happens on the same connection instance, so it'll probably be something =
else.
=20
Any idea's ?
=20
Regards,
Quinten
-----
|