Class DbExporter

java.lang.Object
de.bright_side.bdbexport.bl.DbExporter

public class DbExporter
extends java.lang.Object
  • Field Details

  • Constructor Details

  • 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 connection
      objectType - type of object to be exported
      catalog - null for default
      schema - 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 export
      outputStream - the exported data is written to the output stream
      cancelReceiver - 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 export
      cancelReceiver - 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 export
      cancelReceiver - 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