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?
CEHJConnect With a Mentor Commented:
Read as tokens, insert as fields

int fieldNum = 0;
StringTokenizer st = new StringTokenizer(fileLine);
while ( st.hasMOreTokens()) {
  ps.setString(++fieldNum, st.nextToken());
Tommy BraasCommented:
ps in CEHJ's example is a PreparedStatement.
johnbert_99Author Commented:
can u maybe explain more?....
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.