I am trying to insert csv file in postgresql database using java
the code is
CopyManager copyManager = new CopyManager((BaseConnection) conn);
FileReader fileReader = new FileReader(filename);
copyManager.copyIn("COPY meta.fk_payment_temp(\n"+
"settlement_ref_no, order_type, fulfilment_type, seller_sku, wsn, \n" +
" order_id, order_item_id, order_date, dispatch_date, delivery_date, \n" +
" cancellation_date, settlement_date, order_status, quantity, order_item_value, \n" +
" refund, protection_fund, total_marketplace_fee, service_tax, \n" +
" settlement_value, commission_rate, commission, fee_discount, \n" +
" cancellation_fee, fixed_fee, emi_fee, total_weight, shipping_fee, \n" +
" reverse_shipping_fee, shipping_zone, token_of_apology, pick_and_pack_fee, \n" +
" storage_fee, removal_fee, invoice_id, invoice_date, invoice_amount, \n" +
" sub_category, total_offer_amount, my_offer_share, flipkart_offer_share)\n" +
" FROM STDIN with csv header delimiter ','", fileReader );
there is 41 column in csv file and as well as in table
the error detail is:
Where: COPY fk_payment_temp, line 2: "NFT-150331087GN00107XXXXXXX,prepaid,NON-FA,BD46-157,,OD102411813209536003,166288248,"Mar 25, 2015","..."
as we seen error is in "Mar 25, 2015" but the data is
NFT-150331087GN00107XXXXXXX prepaid NON-FA BD46-157 OD102411813209536003 166288248 25-Mar-15 26-Mar-15 27-Mar-15 31-Mar-15 delivered 1 339 339 0 0 -85.26 -10.54 243.2 15 -50.86 0 0 -5 0 0.3 -29.4 0 LOCAL 0 0 0 0 IN27248 26-Mar-15 309 babydoll 0 0 0
how i can solve this ?