|
View:
New views
9 Messages
—
Rating Filter:
Alert me
|
|
|
database export to dbunti xmlI am trying to export my database inot flat xml file for unit testing.I follwed this example http://www.dbunit.org/faq.html#extract
I am ending up with this exception please hlep me resolve this Exception in thread "main" org.dbunit.database.AmbiguousTableNameException: PLAN_TABLE at org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:161) at org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:203) at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:251) at org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(SequenceTableFilter.java:110) at org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTableFilter.java:129) at org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89) at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189) at org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(DataSetProducerAdapter.java:63) at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122) at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:323) at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40) I also tried the suggfestion http://www.gigantiq.com/blogs/mike/?p=10 but did not work , any how this artricle did not said the value for DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
Re: database export to dbunti xmlAre you specifying the schema? Sounds like you have PLAN_TABLE in multiple schemas. This is normal with Oracle.
Regards John Hurst Wellington, New Zealand On Tue, Jul 21, 2009 at 3:42 PM, tubin gen <fachhoch@...> wrote: I am trying to export my database inot flat xml file for unit testing.I follwed this example http://www.dbunit.org/faq.html#extract ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
Re: database export to dbunti xmlHi I have got same issue.
I have solved (temporarily) with replacing the exception with stdout message. The best recommendation was create table filter, see in mailing list. I have got same issue with column names. I could send you diff files. Regards, Zdenek On Tue, Jul 21, 2009 at 4:42 AM, tubin gen<fachhoch@...> wrote: > I am trying to export my database inot flat xml file for unit testing.I > follwed this example http://www.dbunit.org/faq.html#extract > > I am ending up with this exception please hlep me resolve this > > > Exception in thread "main" org.dbunit.database.AmbiguousTableNameException: > PLAN_TABLE > at > org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:161) > at > org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:203) > at > org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:251) > at > org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(SequenceTableFilter.java:110) > at > org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTableFilter.java:129) > at > org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89) > at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189) > at > org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(DataSetProducerAdapter.java:63) > at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122) > at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:323) > at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40) > > > I also tried the suggfestion http://www.gigantiq.com/blogs/mike/?p=10 but > did not work , any how this artricle did not said the value for > DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES > > my code to set this property > connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES, > "true"); > > please tell me what should be the value for this property . > > > > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > dbunit-user mailing list > dbunit-user@... > https://lists.sourceforge.net/lists/listinfo/dbunit-user > > ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
Re: database export to dbunti xmlplease send them.
thanks
|
|
|
Re: database export to dbunti xmlPlease take a look at the FAQ, as there is a specific question on AmbiguousTableNameException. This should solve your problem.
Regards, Luiz 2009/7/21 tubin gen <fachhoch@...> I am trying to export my database inot flat xml file for unit testing.I follwed this example http://www.dbunit.org/faq.html#extract ------------------------------------------------------------------------------ _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
|
|
|
Re: database export to dbunti xmlIn my opinion it's unfortunate that getConfig().setFeature() and getConfig().setProperty() don't throw an exception when given a a feature or property that they can't use. I made this mistake and even saw the warning in the log files, but being the wooden head that I am it took me a while to realize what was wrong.
Matthias Gommeringer wrote: > Hi there, > > try using the "getConfig().setFeature" instead of the "getConfig().setProperty()" since you are willing to set a feature here. > > rgds, > matthias > >> -----Ursprüngliche Nachricht----- >> Von: "Luiz Eduardo Guida Valmont" <legvalmont@...> >> Gesendet: 21.07.09 19:06:54 >> An: dbunit-user@... >> Betreff: Re: [dbunit-user] database export to dbunti xml > > Please take a look at the FAQ, as there is a specific question on >> AmbiguousTableNameException. This should solve your problem. >> >> Regards, >> Luiz >> >> 2009/7/21 tubin gen <fachhoch@...> >> I am trying to export my database inot flat xml file for unit testing. >> I follwed this example http://www.dbunit.org/faq.html#extract >> >> I am ending up with this exception please hlep me resolve this >> >> Exception in thread "main" org.dbunit.database.AmbiguousTableNameExcept >> ion: PLAN_TABLE >> at org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap. >> java:161) >> at org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet. >> java:203) >> at org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSe >> t.java:251) >> at org.dbunit.dataset.filter.SequenceTableFilter.getTableNames( >> SequenceTableFilter.java:110) >> at org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTabl >> eFilter.java:129) >> at org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet. >> java:89) >> at org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java: >> 189) >> at org.dbunit.dataset.stream.DataSetProducerAdapter.<init>( >> DataSetProducerAdapter.java:63) >> at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122) >> at org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java: >> 323) >> at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40) >> >> I also tried the suggfestion http://www.gigantiq.com/blogs/mike/?p=10 >> but did not work , any how this artricle did not said the value for >> DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES >> >> my code to set this property >> connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_ >> RECYCLEBIN_TABLES, "true"); >> >> please tell me what should be the value for this property . >> >> ---------------------------------------------------------------------- >> -------- >> Enter the BlackBerry Developer Challenge >> This is your chance to win up to $100,000 in prizes! For a limited >> time, >> vendors submitting new applications to BlackBerry App World(TM) will >> have >> the opportunity to enter the BlackBerry Developer Challenge. See full >> prize >> details at: http://p.sf.net/sfu/Challenge >> _______________________________________________ >> dbunit-user mailing list >> dbunit-user@... >> https://lists.sourceforge.net/lists/listinfo/dbunit-user >> >> ---------------------------------------------------------------------- >> --------_______________________________________________ dbunit-user >> mailing list dbunit-user@... https://lists. >> >> sourceforge.net/lists/listinfo/dbunit-user > > > ________________________________________________________________ > Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate > für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/ > > > ------------------------------------------------------------------------------ > _______________________________________________ > dbunit-user mailing list > dbunit-user@... > https://lists.sourceforge.net/lists/listinfo/dbunit-user ------------------------------------------------------------------------------ _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
|
|
|
|
|
Re: database export to dbunti xmlHi,
here is the diff which filter out column name duplicates from Oracle Metadata. I am currently using 4.6. SNAPSHOT. I am sure there is better way to do it (at least filter out duplicate tables). Index: src/java/org/dbunit/dataset/OrderedTableNameMap.java =================================================================== --- src/java/org/dbunit/dataset/OrderedTableNameMap.java (revision 1013) +++ src/java/org/dbunit/dataset/OrderedTableNameMap.java (working copy) @@ -187,6 +187,7 @@ */ public void add(String tableName, Object object) throws AmbiguousTableNameException { + System.out.println(tableName); if(LOGGER.isDebugEnabled()) LOGGER.debug("add(tableName={}, object={}) - start", tableName, object); @@ -195,7 +196,8 @@ // prevent table name conflict if (this.containsTable(tableNameCorrectedCase)) { - throw new AmbiguousTableNameException(tableNameCorrectedCase); + //throw new AmbiguousTableNameException(tableNameCorrectedCase); + System.out.println("table name twice! table name: " + tableName); } else { this._tableMap.put(tableNameCorrectedCase, object); Index: src/java/org/dbunit/database/DatabaseTableMetaData.java =================================================================== --- src/java/org/dbunit/database/DatabaseTableMetaData.java (revision 1013) +++ src/java/org/dbunit/database/DatabaseTableMetaData.java (working copy) @@ -321,6 +321,7 @@ DatabaseConfig.FEATURE_DATATYPE_WARNING); List columnList = new ArrayList(); + List columnNames = new ArrayList(); while (resultSet.next()) { // Check for exact table/schema name match because @@ -329,9 +330,10 @@ if(match) { Column column = SQLHelper.createColumn(resultSet, dataTypeFactory, datatypeWarning); - if(column != null) + if(column != null && !columnNames.contains( column.getColumnName() )) { columnList.add(column); + columnNames.add(column.getColumnName()); } } else Regards, Zdenek On Tue, Jul 21, 2009 at 5:09 PM, fachhoch<fachhoch@...> wrote: > > please send them. > thanks > > > Zdenek Vrablik wrote: >> >> Hi I have got same issue. >> >> I have solved (temporarily) with replacing the exception with stdout >> message. >> >> The best recommendation was create table filter, see in mailing list. >> >> I have got same issue with column names. >> >> I could send you diff files. >> >> Regards, >> Zdenek >> >> On Tue, Jul 21, 2009 at 4:42 AM, tubin gen<fachhoch@...> wrote: >>> I am trying to export my database inot flat xml file for unit testing.I >>> follwed this example http://www.dbunit.org/faq.html#extract >>> >>> I am ending up with this exception please hlep me resolve this >>> >>> >>> Exception in thread "main" >>> org.dbunit.database.AmbiguousTableNameException: >>> PLAN_TABLE >>> at >>> org.dbunit.dataset.OrderedTableNameMap.add(OrderedTableNameMap.java:161) >>> at >>> org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:203) >>> at >>> org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:251) >>> at >>> org.dbunit.dataset.filter.SequenceTableFilter.getTableNames(SequenceTableFilter.java:110) >>> at >>> org.dbunit.dataset.filter.SequenceTableFilter.iterator(SequenceTableFilter.java:129) >>> at >>> org.dbunit.dataset.FilteredDataSet.createIterator(FilteredDataSet.java:89) >>> at >>> org.dbunit.dataset.AbstractDataSet.iterator(AbstractDataSet.java:189) >>> at >>> org.dbunit.dataset.stream.DataSetProducerAdapter.<init>(DataSetProducerAdapter.java:63) >>> at org.dbunit.dataset.xml.FlatXmlWriter.write(FlatXmlWriter.java:122) >>> at >>> org.dbunit.dataset.xml.FlatXmlDataSet.write(FlatXmlDataSet.java:323) >>> at gov.hhs.acf.DbUnitXmlExport.main(DbUnitXmlExport.java:40) >>> >>> >>> I also tried the suggfestion http://www.gigantiq.com/blogs/mike/?p=10 >>> but >>> did not work , any how this artricle did not said the value for >>> DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES >>> >>> my code to set this property >>> connection.getConfig().setProperty(DatabaseConfig.FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES, >>> "true"); >>> >>> please tell me what should be the value for this property . >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Enter the BlackBerry Developer Challenge >>> This is your chance to win up to $100,000 in prizes! For a limited time, >>> vendors submitting new applications to BlackBerry App World(TM) will have >>> the opportunity to enter the BlackBerry Developer Challenge. See full >>> prize >>> details at: http://p.sf.net/sfu/Challenge >>> _______________________________________________ >>> dbunit-user mailing list >>> dbunit-user@... >>> https://lists.sourceforge.net/lists/listinfo/dbunit-user >>> >>> >> >> ------------------------------------------------------------------------------ >> Enter the BlackBerry Developer Challenge >> This is your chance to win up to $100,000 in prizes! For a limited time, >> vendors submitting new applications to BlackBerry App World(TM) will have >> the opportunity to enter the BlackBerry Developer Challenge. See full >> prize >> details at: http://p.sf.net/sfu/Challenge >> _______________________________________________ >> dbunit-user mailing list >> dbunit-user@... >> https://lists.sourceforge.net/lists/listinfo/dbunit-user >> >> > > -- > View this message in context: http://www.nabble.com/database-export-to-dbunti-xml-tp24581227p24590719.html > Sent from the DBUnit - Users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > _______________________________________________ > dbunit-user mailing list > dbunit-user@... > https://lists.sourceforge.net/lists/listinfo/dbunit-user > ------------------------------------------------------------------------------ _______________________________________________ dbunit-user mailing list dbunit-user@... https://lists.sourceforge.net/lists/listinfo/dbunit-user |
| Free embeddable forum powered by Nabble | Forum Help |