public class DatabaseExporter extends Object
| Constructor and Description |
|---|
DatabaseExporter() |
| Modifier and Type | Method and Description |
|---|---|
static void |
exportDatabase(Connection conn,
OdsDocument document) |
static void |
exportDatabase(DataSource dataSource,
OdsDocument document)
Create a sheet per table, and write the data.
|
static void |
main(String[] args)
Usage:
$ java -cp path/to/fastods/jar:path/to/jdbc/driver/jar [connection string] [target.ods]
Example:
$ java -cp $HOME/.m2/repository/com/github/jferard/fastods/0.7.4/fastods-0.7.4.jar:$HOME/.m2/repository/org/xerial/sqlite-jdbc/3.27.2.1/sqlite-jdbc-3.27.2.1.jar com.github.jferard.fastods.tool.DatabaseExporter "jdbc:sqlite:$HOME/test.sqlite3" "$HOME/export.ods"
Please avoid exporting huge databases: LibreOffice won't open huge documents.
|
public static void main(String[] args) throws SQLException, IOException
$ java -cp path/to/fastods/jar:path/to/jdbc/driver/jar [connection string] [target.ods]
Example:
$ java -cp $HOME/.m2/repository/com/github/jferard/fastods/0.7.4/fastods-0.7.4.jar:$HOME/.m2/repository/org/xerial/sqlite-jdbc/3.27.2.1/sqlite-jdbc-3.27.2.1.jar com.github.jferard.fastods.tool.DatabaseExporter "jdbc:sqlite:$HOME/test.sqlite3" "$HOME/export.ods"
Please avoid exporting huge databases: LibreOffice won't open huge documents.
args - the parameters: connection string and targetSQLException - if a SQL exception occursIOException - if an I/O error occurspublic static void exportDatabase(DataSource dataSource, OdsDocument document) throws SQLException, IOException
dataSource - the data sourcedocument - the documentSQLException - if there is a SQL exceptionIOException - if there is an I/O exceptionpublic static void exportDatabase(Connection conn, OdsDocument document) throws SQLException, IOException
SQLExceptionIOExceptionCopyright © 2016–2021. All rights reserved.