Create a remote external table in a JDBC application

Create a remote external table in a JDBC application by issuing the CREATE EXTERNAL TABLE SQL statement with the REMOTESOURCE 'JDBC' option.

Named external table

To create a remote external table, enter the following code:

CREATE EXTERNAL TABLE EXT_EMPLOYEE 
   (ID INT, NAME VARCHAR (50)) 
    USING (dataobject ('/tmp/employee.dat')  
           DELIMITER ','  
           MAXERRORS 10   
           SOCKETBUFSIZE 30000 
           REMOTESOURCE 'JDBC'   
           LOGDIR '/logs')

The DATAOBJECT option specifies the external table file path and it must refer to a valid file on the client workstation. You must have permission to read from the path of the data object. The DATAOBJECT option can also specify the path to a named pipe. You must have permission to read from the pipe.

The SOCKETBUFSIZE value is used by the IBM® Data Server Driver for JDBC and SQLJ for streaming log files or bad files and during an unload operation.

The REMOTESOURCE option must be specified as 'JDBC'.

The LOGDIR option is to specify the path where log/bad files must be saved by the driver during the load operation.

Transient External Table

Transient external tables (TET) provide a way to define an external table that exists only during a single query while you perform either load or unload operation. Transient external tables have the same capabilities and limitations as named external tables.