:: com :: sun :: star :: sdb :: application ::

service CopyTableWizard
Supported Interface
XCopyTableWizard


Constructors' Summary
create creates an executable wizard dialog, which is to guide the user through copying a table from one database to another.  
createWithInteractionHandler creates an executable wizard dialog, which is to guide the user through copying a table from one database to another.  
Constructors' Details
create
create( [in] ::com::sun::star::beans::XPropertySet  Source,
[in] ::com::sun::star::beans::XPropertySet  Destination )
raises( ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::sdbc::SQLException,
::com::sun::star::lang::WrappedTargetException );

Description
creates an executable wizard dialog, which is to guide the user through copying a table from one database to another.

At creation time, an attempt will be made to obtain the connections described by Source resp. Dest. Failing to do so will result in an exception.

If the connection has been newly created by the wizard (e.g. because the data access descriptor specified a DataSource instead of an ActiveConnection), then this connection will be disposed upon disposal of the wizard.

Parameter Source
the ::com::sun::star::sdb::DataAccessDescriptor describing the data to copy.

The following members of the DataAccessDescriptor are supported, and evaluated in the given order:

  1. ActiveConnection
  2. DataSourceName
  3. DatabaseLocation
  4. ConnectionResource
  5. ConnectionInfo
  6. Command
  7. CommandType
The first 5 items are used to obtain the connection, the last two to determine which of the connection's objects is to be copied. Note that Command and CommandType are required.

Additionally to the obvious restrictions (such as that creating a view is not possible if the copy source and the copy destination denote different databases), the following restrictions apply to the settings, and possible combinations:

  • Only ::com::sun::star::sdb::CommandType::TABLE and ::com::sun::star::sdb::CommandType::QUERY are supported.
  • If you specify a ConnectionResource, or an ActiveConnection which implements an ::com::sun::star::sdbc::Connection only (as opposed to a ::com::sun::star::sdb::Connection), then the resulting connection is not able to provide queries, thus a command type QUERY will be rejected.
  • Filter, Order, HavingClause and GroupBy are unsupported at the moment.
Violating any of the above restrictions will result in an error at creation time.

Parameter Destination
the ::com::sun::star::sdb::DataAccessDescriptor describing the target for the copy operation.

Only DataSourceName, DatabaseLocation, ActiveConnection are supported, effectively describing the target connection to copy the data to. They're evaluated in the order mentioned here, so if multiple of the are present, only the first one is evaluated.

Also, at the moment the connection which is implied by either of the settings above must support the ::com::sun::star::sdb::Connection service. In particular, it is not sufficient to pass an SDBC-level connection.

Note that creating a view (see CopyTableOperation::CreateAsView) is not supported if the target connection is an SDBC-level connection only.

Throws
::com::sun::star::lang::IllegalArgumentException if
  • either Source or Destination is NULL
  • either Source or Destination are not sufficient to describe a database connection.
  • Source is not sufficient to describe the to-be-copied data
  • either Source or Destination contain unsupported settings.
Throws
::com::sun::star::sdbc::SQLException if an error occurs during obtaining the source or destination connection. Those errors are passed unchanged to the creator of the wizard.
Throws
::com::sun::star::lang::WrappedTargetException if an error other than the ones mentioned above occurs while extracting the necessary information from any of the data access descriptors. For instance, this might be an ::com::sun::star::sdbc::SQLException thrown upon connecting to a data source described by the descriptor's DataSourceName member.
See also
::com::sun::star::sdb::DataAccessDescriptor
createWithInteractionHandler
createWithInteractionHandler( [in] ::com::sun::star::beans::XPropertySet  Source,
[in] ::com::sun::star::beans::XPropertySet  Destination,
[in] ::com::sun::star::task::XInteractionHandler  InteractionHandler )
raises( ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::sdbc::SQLException,
::com::sun::star::lang::WrappedTargetException );

Description
creates an executable wizard dialog, which is to guide the user through copying a table from one database to another.

The only difference to the create constructor is that createWithInteractionHandler takes an additional argument, which can be used to intercept interactions (such as error messages) during the wizard run.

Parameter InteractionHandler
specifies an interaction handler to use when user input is required.

When specifying this parameter, you should use an implementation supporting the ::com::sun::star::sdb::InteractionHandler, since the general-purpose ::com::sun::star::task::InteractionHandler cannot handle all requests described above.

See also
::com::sun::star::sdb::InteractionHandler

 
Top of Page