Extracting null column values in FlatXMLDataSet

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Extracting null column values in FlatXMLDataSet

Armadello
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 [hidden email] 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Extracting null column values in FlatXMLDataSet

steven.hicks

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: [hidden email] [mailto:[hidden email]] On Behalf Of Dowlagar, Nitesh
Sent: 24 June 2008 13:32
To: [hidden email]
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 [hidden email] 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Extracting null column values in FlatXMLDataSet

Armadello
In reply to this post by Armadello
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: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Tuesday, June 24, 2008 6:18 PM
To: [hidden email]
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: [hidden email] [mailto:[hidden email]] On Behalf Of Dowlagar, Nitesh
Sent: 24 June 2008 13:32
To: [hidden email]
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 [hidden email] 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Extracting null column values in FlatXMLDataSet

yourganesan
This post has NOT been accepted by the mailing list yet.
In reply to this post by Armadello
HI

I am facing the same issue, has this been resolved. I am in desperate need of a solution. Please help me.

Thanks,
Ganesan