java program to read excel/text  and checks oracle database and emails missing records

Posted on 2012-08-28
Last Modified: 2012-09-01
I am looking for a java sample example which reads excel or text file and
 iterate through the records by forming hash map or other object. Forms a query and queries againest oracle database
and generates excel report of any missing records compared to excel/ text file records.Emails the missingrecords report.

I saw this example

But it is not complete on what I was looking. It is inserting instead of 'select' to check missing records.

It mentioned like

int k=stat.executeUpdate("insert into login(username,password) value('"+username+"','"+password+"')");

 is login is the name of the table with columns names username,password in the paranthesis?

 Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
Question by:gudii9
    LVL 20

    Accepted Solution

    Here is the example to read the data from excel by using apache poi..
    LVL 20

    Assisted Solution

    >>But it is not complete on what I was looking.

    You may not be able to find exactly what you're looking for. However, that example provides a solid starting point. You will basically have 3 steps:
    a) read the spreadsheet
    b) query the database
    c) email results

    >>is login is the name of the table with columns names username,password in the paranthesis?

    You can find the documentation for executeUpdate here, you can easily see that it will not be useful in your situation. Instead, you will want to use executeQuery, which returns a ResultSet.  

    Check out this link

    Ideally, you'll want to use a PrepareStatement to build your query, then supply the parameters based on your spreadsheet data.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
    This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
    The viewer will learn how to implement Singleton Design Pattern in Java.

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now