We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Insert to database from text file

johnbert_99
johnbert_99 asked
on
Medium Priority
238 Views
Last Modified: 2010-03-31
How can i insert into an access database using sql which gets the values from a text file?
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
ps in CEHJ's example is a PreparedStatement.

Author

Commented:
can u maybe explain more?....
CERTIFIED EXPERT
Top Expert 2016

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

You can find the Javadocs here: http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html
Mayank SPrincipal Technologist
CERTIFIED EXPERT

Commented:
Reading from a text-file: http://www.javaalmanac.com/egs/java.io/ReadLinesFromFile.html

(you can also have a look at the "Related Examples" and at: http://www.javaalmanac.com/cgi-bin/search/find.pl?words=file)

Inserting a row into a database-table: http://www.javaalmanac.com/egs/java.sql/InsertPs.html
Mayank SPrincipal Technologist
CERTIFIED EXPERT

Commented:
Since points are too less to split, accept CEHJ's comment as answer.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.