JDBC2XML Usage
This section refers to the command-line tool. For information on the uses of the java library, please refer to our java documentation.
Aliases
JDBC2XML registers under several aliases on the command line, to cover the most common usecases. They are presented here with minimal options, see a full list of options below.
Dumping a DB to XML:
jdbc2xml --url <jdbc-url> --file <path-to-file>
Restoring a DB from XML:
xml2jdbc --file <path-to-file> --url <jdbc-url>
Copying from one DB to another
jdbc2jdbc --from-url <jdbc-url> --to-url <jdbc-url>
Parse and copy an XML file
This can be useful for extracting a schema from a database (see options below)
xml2xml --from-file <path-to-file> --to-file <path-to-file>
Test DB connection and server status
jdbcping --url <jdbc-url>
Extract parts of a DB
jdbcextr --url <jdbc-url> --file <path-to-file>
Full list of options
Database access
JDBC URL to access the DB (like jdbc:servertype://host[:port]/db[?options]):
--from-url "jdbcurl" --to-url "jdbcurl" --url "jdbcurl"
User to access the DB (some drivers can parse that from the URL):
--from-user user --to-user user --user user
Password to access the DB (some drivers can parse that from the URL):
--from-password password --to-password password --password password
File access
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
--from-file file --to-file file --file file
Restrict processing to tables
Whitelist tables (comma seperated, without whitespace)
--tables table1,table2,...
Blacklist tables
--exclude-tables table1,table2,...
Do not include table data in dump (creates a full schema from a populated database):
--no-data
Ignore constraints
--no-constraints
Combined--no-data
and --no-constraints
--schema-only
Expert options
Drop the affected tables before actually importing a dump. If --tables
or --exclude-tables
is given, only tables affected by the specified filter are dropped.
--drop-tables
Overrides the default bzip2 output compression, if --to-file
ends with .bz2
--compression <n>
Force a timezone
--timezone timezoneid
allows to select a JDBC driver, overriding autoselection
--from-driver drivername --to-driver drivername --driver drivername
linux only: add given drivers to the classpath
--jdbc-drivers jarfilename[;jarfilename...]
Options for translation to jdbc
Change the batch size for inserts (def.: 1000)
--batch-size n
Fetch the contents of the database using a read-only transaction
--transactional
Options for translation from xml
Enable schema checking on the xml file
--check-xml-schema
Create an extra index on each foreign key
--create-fk-indices
Options for translation to xml
Force or supress pretty printing of xml data
--pretty, --no-pretty
Forces the transformation of SQL identifiers to lower case
--to-lower
Force the transformation of SQL identifiers to upper case
--to-upper
Write internal indices, which are generated by the RDBMS
--keep-internal-indices
Output Verbosity
The default log level prints Fatal
, Error
and Warning
logs
Suppresses any output except for the return code
--quiet
Increase log-level to Info
--verbose
Log everything (command-line spam warning)
--debug
Activate loggers in wrapper scripts (only useful if you know what you're doing)
--debug-startup