How to insert type Date into xml file for sql table

191 Views Asked by At
<?xml version="1.0" encoding="utf-8"?>
<dataset>
    <ROLE ID="1" ROLENAME = "Admin"/>
    <ROLE ID="2" ROLENAME="Guest"/>
    <USERS ID = '1' FIRSTNAME="Barack" LASTNAME="Obama" LOGIN="12312414" PASSWORD = "121121212" EMAIL="ob@" BDAY='1999-04-04' ROLEID='1'/>
    <USERS ID = '2' FIRSTNAME="Hack" LASTNAME="Fill" LOGIN="Bold" PASSWORD = "99999999" EMAIL="BLACk" BDAY = '1991-03-02' ROLEID='2'/>
</dataset>

This is my XML file with users. Column BDAY may be in Date type, but DBunit see it like String. How can I fix it?

1

There are 1 best solutions below

0
Jeff On

dbUnit will automatically convert XML data to the target database column type, e.g. dates. However, the data file dates must exist in the expected Java date format.