![]() |
jDBSync | ||||||||||||||||||||||||||||||||||||||||||||||
|
Export taskThis task is used to export data from DB to XML file. There are two ways to use this task:
Java class is org.chur.ant.db.jdbsynch.export.ExportTask Parameters
Parameters specified as nested elementstableUse nested <table> elements to specify which tables should be exported. If there are no any <table> elements all tables in user's DB schema are exported. sqlUse nested <sql> elements if you need to change some DB session's attributes or prepare some data before export will be started. Examples<taskdef name="export" classname="org.chur.ant.db.jdbsynch.export.ExportTask"/> <export driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@tiger:1521:tigerdb" userid="sys" password="change_on_install" schema="SCOTT" dest="export1.xml"/> Connect to DB "tigerdb" and export all tables from "SCOTT" schema to "export1.xml" file. <taskdef name="export" classname="org.chur.ant.db.jdbsynch.export.ExportTask"/> <export driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@tiger:1521:tigerdb" userid="sys" password="change_on_install" dest="export1.xml" profile="mysql"> <sql>ALTER SESSION SET CURRENT_SCHEMA=SCOTT</sql> <table tableName="CUSTOMERS"/> <table tableName="CITIES"/> </export> Connect to DB "tigerdb" and export all data from two tables (CUSTOMERS and CITIES) from "SCOTT" schema to "export1.xml" file. To connect is used "sys" login. After login and before do export current schema will be changed to SCOTT. To convert data will be used profile of MySQL. |