Insert to database from text file

How can i insert into an access database using sql which gets the values from a text file?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Read as tokens, insert as fields

int fieldNum = 0;
StringTokenizer st = new StringTokenizer(fileLine);
while ( st.hasMOreTokens()) {
  ps.setString(++fieldNum, st.nextToken());

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tommy BraasCommented:
ps in CEHJ's example is a PreparedStatement.
johnbert_99Author Commented:
can u maybe explain more?....
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Please give the format of the text file
Tommy BraasCommented:
A PreparedStatement is an easy  way to add content to a query statement or update/insert statement.

You can find the Javadocs here:
Mayank SAssociate Director - Product EngineeringCommented:
Reading from a text-file:

(you can also have a look at the "Related Examples" and at:

Inserting a row into a database-table:
Mayank SAssociate Director - Product EngineeringCommented:
Since points are too less to split, accept CEHJ's comment as answer.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.