How to import CSV file data into a PostgreSQL table via java code?

Viewed 2992

I have a csv file which I want to import to table in postgres

The table contains 3 fields (id text, name text, geo geometry). The csv file is in the same format (3 values separate with comma).

I want to use java code in order to import the file (input.csv) into the table (tbl)

How can I do it ? Is there a query which I pass the file path to the DB ?

1 Answers
Related