skip to main content
Using the JDBC Client : Using DataDirect Bulk Load : Using CSV Files : Discard File
 

Discard File

If the driver was unable to load rows into the database for a bulk load operation from a CSV file, it can record all the rows that were unable to be loaded into the database in the discard file. The contents of the discard file is in the same format as that of the CSV file. After fixing reported issues in the discard file, the bulk load can be reissued, using the discard file as the CSV file.
A discard file is created by specifying a file name and location for the discard file using the setDiscardFile() method.

Example A: Creating a Discard File on Windows

To create a discard file named discard.csv located in the C:\temp directory, specify:
bulkLoad.setDiscardFile(C:\\temp\\discard.csv)
Note: If coding a path on Windows to the log file in a Java string, the backslash character (\) must be preceded by the Java escape character, a backslash. For example: C:\\temp\\discard.csv.

Example B: Creating a Discard File on UNIX/Linux

To create a discard file named discard.csv located in the /tmp directory, specify:
bulkLoad.setDiscardFile(/tmp/discard.csv)