Below Code is to Migrate the CSV,txt files to JDBC Tables.

Need to follow few step to Migrate the csv files to tables.


1. First we need to copy all the CSV or txt files to a folder and create a file data source (local or shared folder). 

2. Create a manifest file, which consist data source name from where the files need to be taken, file path, delimiter, header, target data source name, schema name and Table name. Please find the attached sample file.

3. To read this manifest file we need to put this file in any file data source path (ex: "CSVlocal").

4. After above 3 steps you need to Create a dataflow and add a Code Component and copy the code from the attached files. One if local files to jdbc tables and the other is from shared folder files to jdbc tables.

5. The code will read one line at a time and get the Source database name, file name, delimiter, header, Target database name, schema name and Table name from the file.

6. Application will connect to the source database and fetch the data from the given file, delimiter and header options and Get the details of target database and creates a connection and put the file data into a given table with schema name.

7. Application will create a table name if doesn't exist. If table name already exist it will over write.