To create a DDBulkLoad object, create an instance of the DDBulkLoadFactory class as shown in the following examples.Connection con = DriverManager.getConnection(
"jdbc:datadirect:oracle://server3:1521;ServiceName=ORCL;User=test;
Password=secret");Connection con = DriverManager.getConnection(
"jdbc:datadirect:sforce://login.salesforce.com;User=test@abccorp.com;
Password=secret");Once your application has created a DDBulkLoad object, you can use the DDBulkLoad methods to provide the driver with the following instructions:
![]()
The location where the driver obtains the data to load. The driver can obtain data from either of the following sources:
![]()
Comma-separated value (CSV) file. The driver can export data from a table or ResultSet object into a CSV file, or the driver can use a CSV file created by another DataDirect Connect product.
![]()
The location where the driver loads the data (table name, and optionally for the Salesforce driver, column names)Suppose after upgrading from an Oracle 10g database to an Oracle 11g database, you need to migrate data from the old database to the new database. The following figure shows how your application would load the data from a ResultSet object created from a query. This scenario assumes that the Oracle driver is connected to both databases.
1. The application executes a query to the Oracle 10g database in the normal way and retrieves the results in a ResultSet object.
2. The application creates a DDBulkLoad object and instructs the driver to load data from the ResultSet object into the Oracle 11g database.Using the same scenario as described in Example C, the following figure shows how you would load the data using a CSV file instead of a ResultSet object. The CSV file is created by exporting data from an Oracle 10g table.
2. The application specifies that the driver export the data from an Oracle 10g table into a CSV file.
3. The application instructs the driver to load data from the CSV file into the Oracle 11g table. The driver loads the data from the CSV file into the Oracle 11g table.For instructions on loading data, see Loading Data From a ResultSet Object and Loading Data From a CSV File.See Permissions for Bulk Load from a CSV File for information about granting permissions for bulk loading from a CSV file.Refer to JDBC Extensions in the DataDirect Connect Series for JDBC Reference for a description of the bulk load methods.
| © 2012 Progress Software Corporation and/or its subsidiaries or affiliates. |