Extracting null column values in FlatXMLDataSet

View: New views
3 Messages — Rating Filter:   Alert me  

Extracting null column values in FlatXMLDataSet

by Armadello :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
 
I am trying to extract database rows and write to an xml file but this seems to be working
only for columns that have values ( i.e not null ) but the QueryDataset is missing the columns
having null value.
 
Has anybody faced similar issues ? Is there any work around for this apart from having a DTD defined for the specific table?
 
Thanks and regards
Nitesh

“THANK GOD IT’S MONDAY!” Sounds interesting? Know more @ www.broadridge.com.

 

This message is confidential and may also be legally privileged. If you are not the intended recipient, please notify postmaster@... immediately. You should not copy it for any purpose, nor disclose its contents to any other person. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of Broadridge.

 

This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the 
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
dbunit-user mailing list
dbunit-user@...
https://lists.sourceforge.net/lists/listinfo/dbunit-user

Re: Extracting null column values in FlatXMLDataSet

by steven.hicks :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Nitesh

 

I have had to cope with NULL values using DbUnit and for me I found the easiest solution was to use ReplacementDataSet. See http://www.dbunit.org/components.html#FlatXmlDataSet and search for ReplacementDataSet (I did look at the DTD option but this seemed more work).

 

Example for what I used it for:

From

<GROUP_CODE_IMPORT_LINK GROUP_ID="196" CN_CODE="1102"/>

to

<GROUP_CODE_IMPORT_LINK GROUP_ID="196" CN_CODE="1102" EX_INDICATOR="[NULL]"/>

 

expectedFlatDataSet = new FlatXmlDataSet(getClass().getResourceAsStream(expectedFlatResultsFile));

replacementExpectedDataSet = new ReplacementDataSet(expectedFlatDataSet);

replacementExpectedDataSet.addReplacementObject("[NULL]", null);

 

 


From: dbunit-user-bounces@... [mailto:dbunit-user-bounces@...] On Behalf Of Dowlagar, Nitesh
Sent: 24 June 2008 13:32
To: dbunit-user@...
Subject: [dbunit-user] Extracting null column values in FlatXMLDataSet

 

Hi,

 

I am trying to extract database rows and write to an xml file but this seems to be working

only for columns that have values ( i.e not null ) but the QueryDataset is missing the columns

having null value.

 

Has anybody faced similar issues ? Is there any work around for this apart from having a DTD defined for the specific table?

 

Thanks and regards

Nitesh

“THANK GOD IT’S MONDAY!” Sounds interesting? Know more @ www.broadridge.com.

 

This message is confidential and may also be legally privileged. If you are not the intended recipient, please notify postmaster@... immediately. You should not copy it for any purpose, nor disclose its contents to any other person. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of Broadridge.

 

This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the 
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
dbunit-user mailing list
dbunit-user@...
https://lists.sourceforge.net/lists/listinfo/dbunit-user

Parent Message unknown Re: Extracting null column values in FlatXMLDataSet

by Armadello :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Steven,
 
I do use replacement dataset but only in case where we want to input null values into the database. In my current situation,
I want DBUnit's QueryDataset to fetch me NULL columns so that I can use the write() operation to write into a flat xml file.
 
Many thanks for sharing your experience.
 
Thanks and regards
Nitesh
 


From: dbunit-user-bounces@... [mailto:dbunit-user-bounces@...] On Behalf Of steven.hicks@...
Sent: Tuesday, June 24, 2008 6:18 PM
To: dbunit-user@...
Subject: Re: [dbunit-user] Extracting null column values in FlatXMLDataSet

Nitesh

 

I have had to cope with NULL values using DbUnit and for me I found the easiest solution was to use ReplacementDataSet. See http://www.dbunit.org/components.html#FlatXmlDataSet and search for ReplacementDataSet (I did look at the DTD option but this seemed more work).

 

Example for what I used it for:

From

<GROUP_CODE_IMPORT_LINK GROUP_ID="196" CN_CODE="1102"/>

to

<GROUP_CODE_IMPORT_LINK GROUP_ID="196" CN_CODE="1102" EX_INDICATOR="[NULL]"/>

 

expectedFlatDataSet = new FlatXmlDataSet(getClass().getResourceAsStream(expectedFlatResultsFile));

replacementExpectedDataSet = new ReplacementDataSet(expectedFlatDataSet);

replacementExpectedDataSet.addReplacementObject("[NULL]", null);

 

 


From: dbunit-user-bounces@... [mailto:dbunit-user-bounces@...] On Behalf Of Dowlagar, Nitesh
Sent: 24 June 2008 13:32
To: dbunit-user@...
Subject: [dbunit-user] Extracting null column values in FlatXMLDataSet

 

Hi,

 

I am trying to extract database rows and write to an xml file but this seems to be working

only for columns that have values ( i.e not null ) but the QueryDataset is missing the columns

having null value.

 

Has anybody faced similar issues ? Is there any work around for this apart from having a DTD defined for the specific table?

 

Thanks and regards

Nitesh

"THANK GOD IT'S MONDAY!" Sounds interesting? Know more @ www.broadridge.com.

 

This message is confidential and may also be legally privileged. If you are not the intended recipient, please notify postmaster@... immediately. You should not copy it for any purpose, nor disclose its contents to any other person. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of Broadridge.

 

This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the 
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.
This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the 
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
dbunit-user mailing list
dbunit-user@...
https://lists.sourceforge.net/lists/listinfo/dbunit-user
LightInTheBox - Buy quality products at wholesale price