This section refers to the command-line tool. For information on the uses of the java library, please refer to our java documentation.
JDBC2XML provides several commands, triggering different operations.
The following command overview only shows the absolut minimal number of options.
Usually more options are needed, especially
--password, and (Linux only, see bottom)
See far below for a full list of options, as well as examples for JDBC URLs.
Dumping a DB to XML
See below for details and example for JDBC URLs.
Restoring a DB from XML
Copying from one DB to another
Parse and copy an XML file
This can be useful for extracting a schema from a database (see options below)
Test DB connection and server status
Extract parts of a DB
JDBC URLs basically look like
jdbc:servertype://host[:port]/db?options., but some Databases and/or JDBC Drivers like other variants.
Typical examples are:
The use of cursor fetching in mysql is highly recommended in order to circumvent java heap space exceptions while dumping the content of large tables.
Full list of options
JDBC URL to access the DB.
User to access the DB (some drivers can parse that from the URL):
Password to access the DB (some drivers can parse that from the URL):
Win32 wrapper needs absolut paths. The given filenames may contain compressed input. The implementation instantiates an appropriate inflating/deflating stream if the filename ends with .gz or .bz2
Restrict processing to tables
Whitelist tables (comma seperated, without whitespace)
Do not include table data in dump (creates a full schema from a populated database):
Drop the affected tables before actually importing a dump. If
--exclude-tables is given, only tables affected by the specified filter are dropped.
Overrides the default bzip2 output compression, if
--to-file ends with .bz2
Force a timezone
allows to select a JDBC driver, overriding autoselection
Linux only: add given drivers to the classpath
Options for jdbc behaviour
Change the batch size for inserts (def.: 1000)
Fetch the contents of the database using a read-only transaction
Options for xml reading
Enable schema checking on the xml file
Create an extra index on each foreign key
Options for xml creation
Force or supress pretty printing of xml data
Forces the transformation of SQL identifiers to lower case
Force the transformation of SQL identifiers to upper case
Write internal indices, which are generated by the RDBMS
The default log level prints
Suppresses any output except for the return code
Increase log-level to
Log everything (command-line spam warning)
Activate loggers in wrapper scripts (only useful if you know what you're doing)
Driver packages and paths, and other Backend specific tips