java - Full Dataset Export blank dataset -
i have database in libreoffice base (debian) need export tables xml file. have created piece of eclipse java code follows:
package newdb; import java.io.fileoutputstream; import java.sql.connection; import java.sql.drivermanager; import java.sql.sqlexception; import org.dbunit.database.databaseconnection; import org.dbunit.database.idatabaseconnection; import org.dbunit.database.querydataset; import org.dbunit.dataset.idataset; import org.dbunit.dataset.xml.flatxmldataset; import org.dbunit.dataset.datasetexception; public class extracttestdataset { public static void main(string[] args) throws exception { // database connection class driverclass = class.forname("org.hsqldb.jdbcdriver"); connection jdbcconnection = drivermanager.getconnection "jdbc:hsqldb:/home/debian/documents/database.odb", "sa", ""); idatabaseconnection connection = new databaseconnection(jdbcconnection); // full database export idataset fulldataset = connection.createdataset(); flatxmldataset.write(fulldataset, new fileoutputstream("/home/debian/documents/fulldataset.xml")); } }
after looking @ dbunit pages , other various sites code should correct; database populated, connections valid, there no warnings or errors in code, when xml file created content follows:
<?xml version='1.0' encoding='utf-8'?> <dataset/>
does have ideas why dataset not being exported?
thanks
turns out .odb database connected different backend, explaining blank dataset.
Comments
Post a Comment