There is a whole industry in such db tools. I'm just a lowly Java coder and when all you have is a hammer everthing starts to looks like nails If you just need to do this once or infrequently then it probably doesn't matter how you do this. In Java, you would use a PreparedStatement and its batch methods to batch your inserts, if you can.
most real databases have tools that provide functionality to import with ETL, so if you are using SQL Server, Oracle, DB2 (egads i just choked on bile listing DB2 as a real database) you can write scripts to import your data from say a delimited text file to database tables. you can even schedule them.