Package de.bright_side.bdbexport.bl
Class DbExporter
java.lang.Object
de.bright_side.bdbexport.bl.DbExporter
public class DbExporter
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDbExporter.DbTypestatic classDbExporter.ObjectType -
Field Summary
Fields Modifier and Type Field Description static java.nio.charset.CharsetCHARSETstatic intDEFAULT_CLOB_EXPORT_MAX_LENGTH -
Constructor Summary
Constructors Constructor Description DbExporter() -
Method Summary
Modifier and Type Method Description voidbulkExport(BulkExportRequest exportRequest, CancelReceiver cancelReceiver, java.io.OutputStream outputStream)java.lang.StringbulkExportAsString(BulkExportRequest exportRequest)java.lang.StringbulkExportAsString(BulkExportRequest exportRequest, CancelReceiver cancelReceiver)java.util.List<java.lang.String>getObjectNames(java.sql.Connection connection, DbExporter.ObjectType objectType, java.lang.String catalog, java.lang.String schema)voidobjectExport(ObjectExportRequest exportRequest, java.io.OutputStream outputStream)voidobjectExport(ObjectExportRequest exportRequest, java.io.OutputStream outputStream, CancelReceiver cancelReceiver)java.lang.StringobjectExportAsString(ObjectExportRequest exportRequest)
-
Field Details
-
CHARSET
public static final java.nio.charset.Charset CHARSET -
DEFAULT_CLOB_EXPORT_MAX_LENGTH
public static final int DEFAULT_CLOB_EXPORT_MAX_LENGTH- See Also:
- Constant Field Values
-
-
Constructor Details
-
DbExporter
public DbExporter()
-
-
Method Details
-
getObjectNames
public java.util.List<java.lang.String> getObjectNames(java.sql.Connection connection, DbExporter.ObjectType objectType, java.lang.String catalog, java.lang.String schema) throws java.lang.Exception- Parameters:
connection- JDBC connectionobjectType- type of object to be exportedcatalog- null for defaultschema- null for default- Returns:
- object names ordered by dependencies (approximated)
- Throws:
java.lang.Exception- thrown on errors
-
objectExport
public void objectExport(ObjectExportRequest exportRequest, java.io.OutputStream outputStream) throws java.lang.Exception- Throws:
java.lang.Exception
-
objectExport
public void objectExport(ObjectExportRequest exportRequest, java.io.OutputStream outputStream, CancelReceiver cancelReceiver) throws java.lang.Exception- Parameters:
exportRequest- connection and settings for the exportoutputStream- the exported data is written to the output streamcancelReceiver- the method cancel() may be called while the export is running (e.g. in a different thread while exporting a large table)- Throws:
java.lang.Exception- thrown on errors
-
objectExportAsString
public java.lang.String objectExportAsString(ObjectExportRequest exportRequest) throws java.lang.Exception- Parameters:
exportRequest- connection and settings for the export- Returns:
- the object data as a string
- Throws:
java.lang.Exception- thrown on errors
-
bulkExport
public void bulkExport(BulkExportRequest exportRequest, CancelReceiver cancelReceiver, java.io.OutputStream outputStream) throws java.lang.Exception- Parameters:
exportRequest- connection and settings for the exportcancelReceiver- the method cancel() may be called while the export is running (e.g. in a different thread while exporting many objects). May also be null.outputStream- the exported data is written to the output stream- Throws:
java.lang.Exception- thrown on errors
-
bulkExportAsString
public java.lang.String bulkExportAsString(BulkExportRequest exportRequest, CancelReceiver cancelReceiver) throws java.lang.Exception- Parameters:
exportRequest- connection and settings for the exportcancelReceiver- the method cancel() may be called while the export is running (e.g. in a different thread while exporting many objects)- Returns:
- string that contains the exported data
- Throws:
java.lang.Exception- thrown on errors
-
bulkExportAsString
public java.lang.String bulkExportAsString(BulkExportRequest exportRequest) throws java.lang.Exception- Parameters:
exportRequest- connection and settings for the export- Returns:
- string that contains the exported data
- Throws:
java.lang.Exception- thrown on errors
-