?
Solved

java application to read a text document

Posted on 2012-08-16
4
Medium Priority
?
661 Views
Last Modified: 2012-08-27
Hi,

I am looking for a java application which reads a text document(later on I should be able to change to accept other input formats) say xyz.txt as in attachment.After reading the document with say 2 records java application should build a query againest oracle database and find out if those 2 records are already there or not in a table called 'names' under schema say 'HR'. Accordingly it should prepare a report of missing records document. Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
xyz.txt
0
Comment
Question by:gudii9
4 Comments
 
LVL 28

Assisted Solution

by:dpearson
dpearson earned 668 total points
ID: 38303771
I'm not sure what advice you're looking for here - obviously there's a lot to writing a full application to do all this.

Step 1 for reading a text document is explained here:
http://www.javapractices.com/topic/TopicAction.do?Id=42
http://www.roseindia.net/java/beginners/java-read-file-line-by-line.shtml

Doug
0
 
LVL 26

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 664 total points
ID: 38304127
Hi!

Look at this website here for sample code and to get ideas :)
http://www.java2s.com

This chapter is on how to handle Files in various ways :)
http://www.java2s.com/Code/Java/File-Input-Output/CatalogFile-Input-Output.htm

Regards,
    Tomas Helgi
0
 
LVL 21

Accepted Solution

by:
Amitkumar P earned 668 total points
ID: 38305163
You can use apache commons io APIs "IOUtils.java" class that will give you a List of string for each line in the file. Then use StringTokenizer and extract the field values to  be used in the query and form the query.

Refer the API
http://www.docjar.com/html/api/org/apache/commons/io/IOUtils.java.html
0
 
LVL 7

Author Comment

by:gudii9
ID: 38316834
Can you please let me know how to form the query to after readog the string for each line in the file. Please advise
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses
Course of the Month14 days, 4 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question