skip to main content
Using the JDBC Client : Using DataDirect Bulk Load : Using a DDBulkLoad Object : Loading Data From a CSV File
 

Loading Data From a CSV File

Use the setTableName() method to specify the table to load the data. Then, use the load() method, specifying the CSV file. For example, to load data from a file named tmp.csv into a table named GBMAXTABLE, you would specify:
bulkLoad.setTableName("GBMAXTABLE");
and
bulkLoad.load("tmp.csv");
Alternatively, you can create a file reference to the CSV file, and use the load() method to specify the file reference:
File csvFile = new File("tmp.csv");
bulkLoad.load(csvFile);
Use the BulkLoadBatchSize property to specify the number of rows the driver loads at a time when bulk loading data. Performance can be improved by increasing the number of rows the driver loads at a time because fewer network round trips are required. Be aware that increasing the number of rows that are loaded also causes the driver to consume more memory on the client. See DataDirect Bulk Load Methods for more information about bulk load methods.