tangocharlie7
tangocharlie7

Reputation: 33

How Import data from a text file in a table created in mysql using java?

I have first read the data from database using File writer function and stored the text file into the database.

Now I want to copy the contents of that text file into a new database created. The text file itself is of 6 mb so the data is quite large. I want to separate fields from that text file and store them in a string and use those strings to transfer the data into new table created. I am confused about the approach.

I know how can I read the data from the text file as I have already done that and I can display same too using Eclipse console. But how to store the same content of text file in a table of mysql database using java?

Upvotes: 0

Views: 795

Answers (1)

javamonk
javamonk

Reputation: 180

If you are using mysql, use mysqldump dump tables and use -e option with mysql to import tables.

Parse text file and translate to sql is a bit more complicated.

Upvotes: 0

Related Questions